views:

187

answers:

3

I don't want to drop database,

because I'm not hosting the website on my own machine,

drop the database will require create it again,and many settings.

Is there a command in MySQL that can be used to delete all tables in a specific database?

EDIT

Everything I can do is within a phpMyAdmin

+2  A: 

mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE]

Here there are more methods to drop all tables without dropping the database.

Suraj Chandran
+1  A: 

I'm not aware of anything direct to suit your needs. You might try doing the following:

Run this to show your drop commands:

mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | 
grep ^DROP


Nex you can do this to actually execute the drop commands:

mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | 
grep ^DROP | 
mysql -u[USERNAME] -p[PASSWORD] [DATABASE]
codaddict
A: 

Have a look at the docs as well

ghostdog74