Created
June 1, 2015 14:30
-
-
Save a-ast/f134a4c75736a1f6fe9c to your computer and use it in GitHub Desktop.
MySQL clone database
This file contains hidden or 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
| # Created database to be cloned | |
| mysql -u [user] -p -e "create database [destination_database] character set utf8;" | |
| # Backup database with compression | |
| mysqldump -h localhost -u [user] -p --quick [source_database] | gzip > [backup_file] | |
| # Uncompress and restore database | |
| gunzip -c [backup_file] | mysql -u [user] -p [destination_database] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment