Last active
December 14, 2015 18:28
-
-
Save digitup/5129226 to your computer and use it in GitHub Desktop.
Backup and restore 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
rsync /var/lib/mysql [email protected]:/var/lib/ -a | |
Or: | |
//Export Database | |
mysqldump -uUsername -p Database > db_backup.sql | |
//Export Multiple databases | |
mysqldump -uUsername -p --databases db_name1 [db_name2 ...] > db_backup.sql | |
//Export All databases | |
mysqldump -uUsername -p --all-databases > db_backup.sql | |
//Export a table | |
mysqldump -uUsername -p Database Tablename > table_backup.sql | |
//Export multiple tables | |
mysqldump -uUsername -p Database Table1 [Table2 ...] > tables_backup.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment