Created
December 30, 2023 23:44
-
-
Save meysampg/1b08f70b97cc2a25cd5f066a2482cc8f to your computer and use it in GitHub Desktop.
drop all tables of a MySQL database without droping the database
This file contains 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
mysqldump -h $DB_HOST -u $DB_USERNAME --password=$DB_PASSWORD --add-drop-table --no-data $DB_DATABASE | grep -e '^DROP \| FOREIGN_KEY_CHECKS' | mysql -h $DB_HOST -u $DB_USERNAME --password=$DB_PASSWORD $DB_DATABASE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment