Angel Chiang
  • Member for 12 years, 3 months
  • Last seen more than 3 years ago
How to drop all tables in a MySQL database without dropping the database?
Accepted answer
19 votes

There is a simpler bash one-liner using mysqldump (from Thingy Ma Jig Blog). mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [...

View answer