Created
March 31, 2012 22:58
-
-
Save dubgeiser/2269368 to your computer and use it in GitHub Desktop.
Delete all tables in a MySQL database.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo 'show tables;' | mysql -uUSER -pPASSWORD DBNAME | sed '1d' | sed -E 's/^(.*)$/DROP TABLE IF EXISTS `\1`;/' | mysql -uUSER -pPASSWORD DBNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment