MySQL

Drop all tables in a MySQL database

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

Edit: On second thought, reading MySQL docs it says that...

Important
When a database is dropped, user privileges on the database are not automatically dropped.

I should probably test this but it sounds as though a DROP [DATABASE] && CREATE [DATABASE] will do the trick for you.

Tags: 

Subscribe to RSS - MySQL