Backup and Restore Mysql


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.