Last active
June 28, 2016 07:45
-
-
Save tusharvikky/cd90d552011c6801721a7ddbb8e9b4e2 to your computer and use it in GitHub Desktop.
Drop all tables of a DB
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
mysql -u<db_username> -p<db_password> -Nse 'show tables' <db_name> | while read table; do echo "SET FOREIGN_KEY_CHECKS = 0; drop table $table;"; done | mysql -u<db_username> -p<db_password> <db_name> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment