Last active
December 22, 2015 16:09
-
-
Save chetan/6497171 to your computer and use it in GitHub Desktop.
Dump each table to a separate file
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
DB=foo | |
for table in `mysql -uroot $DB -e 'show tables' | grep -v '^Tables_in'`; do | |
echo dumping $table; | |
mysqldump5 -uroot -t --skip-opt --compact $DB $table > t-$table.sql; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment