Last active
December 14, 2019 03:31
-
-
Save girishsalaskar/80968698d8f20e88cfe9f40e00f961ff to your computer and use it in GitHub Desktop.
Dump `mysql` db by tables (See more here : https://codewander.blogspot.com/2019/12/dump-mysql-db-by-tables.html )
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
for T in `mysql -h <host>-P 3306 -uroot -p -N -B -e 'show tables from YOURDBNAME'` | |
do | |
echo "Backing up - $T" | |
mysqldump --skip-comments --compact -h 127.0.0.1 -P 3306 -uroot -p YOURDBNAME $T > /path/to/destination/folder/$T.sql | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment