How to Create a MySQL Database Backup

From Brian Nelson Ramblings
Jump to: navigation, search

How to Create a MySQL Database Backup

Create a backup is something you should do nightly or weekly, that way if the database ever crashes beyond repair you will have a backup.

How to backup the entire database

Backing up the entire database

 mysqldump –u <username> –p <databasename> > dump.sql


mysqldump -u brian -p briansnelsonwiki > briansnelsonwiki-backupdate.sql

How to backup just a table in a database

Backing up just the users tables in database briansnelsonwiki

mysqldump -u<username> -p <databasename> <databasetable> > dumptable.sql


mysqldump -u brian -p briansnelsonwiki users > briansnelsonwiki.users-backupdate.sql