Skip to content

Instantly share code, notes, and snippets.

@zflat
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zflat/ac2f611290704572240c to your computer and use it in GitHub Desktop.
Save zflat/ac2f611290704572240c to your computer and use it in GitHub Desktop.
MySQL database backup
# 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