| Linux CLI: MySQL Backup & Restore |
|
|
|
| Tech Notes - Linux |
| Written by Rick |
| Tuesday, 12 May 2009 18:00 |
|
Backing up and restoring a MySQL database is a relatively easy proposition provided you have adequate access priviledges to the database. The following commands write and read to the current directory. You'll also need sufficient access priviledges in your current directory to execute these. Note:Italic words are user variables.
Backup (a.k.a. Dump) $ mysqldump -u username -p databasename > outputfile.sql
Restore $ mysql -u username -p --database=databasename < outputfile.sql
That's it, short and sweet. Told ya it was easy!
|




