Created
April 28, 2013 20:56
-
-
Save emjayess/5478400 to your computer and use it in GitHub Desktop.
drop mysql tables with the given table prefix 'mytableprefix_'
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 --database=mydb --host=my.host --user=myuser -e "show tables" -s | | |
egrep "^mytableprefix_" | | |
xargs -I "@@" echo mysql --database=mydb --host=my.host --user=myuser -e "DROP TABLE @@"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the above will echo the 'DROP TABLE' statements... drop the echo command to execute them immediately.