It is done through the following query:
delete from `wp_terms` where `term_id` in ( SELECT `term_id`
FROM `wp_term_taxonomy`
WHERE `taxonomy` = 'category' ) and `term_id` not like 1
This query deleted all the category except the default. Hope this helps to the others.