Created
September 28, 2018 02:50
-
-
Save gusreyes01/d5c94e2ca23ada27161ba0a364f3a9f7 to your computer and use it in GitHub Desktop.
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
# This script will truncate all tables from the command line | |
# Don't forget to turn foreign keys back on when you're done | |
mysql -u root --password=PASSWORD -Nse 'show tables' DATABASE | while read table; do mysql -u root --password=PASSWORD -e "SET FOREIGN_KEY_CHECKS=0;truncate table $table" DATABASE;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment