Posted By

jarnaldich on 02/24/08


Tagged

mysql mysqldump


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

basicmagic
awesomehappened
endorfin
umang_nine
fyreflyX


backup mysql databases


 / Published in: Other
 

MySQL backup and restore example through mysqldump / mysql command line utilities.

  1. # Backup:
  2. mysqldump -u<usr> -p<pwd> <db> | gzip > <file>
  3.  
  4. # Restore:
  5. gunzip <file> | mysql -u<usr> -p<pwd> <db>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: awesomehappened on August 1, 2008

# Restore using the SQL file:

mysql -u -p <

Posted By: awesomehappened on August 1, 2008

Ach, sorry. I'm not used to Markdown syntax. The above line should be:

mysql -uuser -ppassword databasename < file.sql

You need to login to post a comment.