Posted By

mitnworb on 02/22/11


Tagged


Versions (?)

Backup and Restore Mysql


 / Published in: SQL
 

  1. Backup
  2.  
  3. mysqldump -u user_name -p[your_password] database_name > File_name.sql
  4.  
  5. This will only work IF the DATABASE does NOT already exist:
  6.  
  7. mysql - u user_name -p your_password database_name < file_name.sql
  8.  
  9. OR USING our example FROM the previous page:
  10.  
  11. IF your DATABASE already EXISTS AND you are just restoring it, try this line instead:
  12.  
  13. mysqlimport -u user_name -p[your_password] database_name file_name.sql
  14.  

Report this snippet  

You need to login to post a comment.