Skip to content

Instantly share code, notes, and snippets.

@pandauxstudio
Last active December 27, 2015 15:59
Show Gist options
  • Save pandauxstudio/7352116 to your computer and use it in GitHub Desktop.
Save pandauxstudio/7352116 to your computer and use it in GitHub Desktop.
Drop all database tables with/without MySQL login.
# With MySQL login
DROP DATABASE dbName;
CREATE DATABASE dbName;
# Without MySQL login
/usr/bin/mysqldump -uuser_name -psecretpassword --add-drop-table database_name | grep ^DROP | /usr/bin/mysql -uuser_name -psecretpassword database_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment