Skip to content

Instantly share code, notes, and snippets.

@jredrejo
Last active April 6, 2016 09:58
Show Gist options
  • Save jredrejo/4fc98497156d226233be2dd322627b57 to your computer and use it in GitHub Desktop.
Save jredrejo/4fc98497156d226233be2dd322627b57 to your computer and use it in GitHub Desktop.
mysql backups
A database:
backup: # mysqldump -u user -p [database_name] > dumpfilename.sql
restore:# mysql -u user -p [database_name] < dumpfilename.sql
Several databases:
mysqldump -u root -p --databases bugs sugarcrm > bugs_sugarcrm.sql
All the databases:
mysqldump -u root -p --all-databases > /tmp/all-database.sql
A single table:
mysqldump -u user -p sugarcrm accounts_contacts > /tmp/sugarcrm_accounts_contacts.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment