Last active
August 29, 2015 14:02
-
-
Save zflat/ac2f611290704572240c to your computer and use it in GitHub Desktop.
MySQL database backup
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
# See http://webcheatsheet.com/SQL/mysql_backup_restore.php | |
# Backup | |
mysqldump -u user -pMyPassword databasename > databasename.sql | |
# Restore | |
# http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/ | |
# Drop the existing table | |
# Create the table | |
# Execute SQL with < to restore the database | |
# mysql -u root -ptmppassword | |
mysql> create database sugarcrm; | |
Query OK, 1 row affected (0.02 sec) | |
# mysql -u root -ptmppassword sugarcrm < /tmp/sugarcrm.sql | |
# Can also use phpMyAdmin | |
# Use the "iport" tool and upload the sql document | |
# http://webcheatsheet.com/SQL/mysql_backup_restore.php | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment