Wednesday, December 22, 2010

How to drop all tables in MYSQL via console

On your console, just type the script below supplying the root access credentials [HOST], [USERNAME], [PASSWORD], and [DATABASE] to access the server.

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

No comments:

Post a Comment