mySQL - database backup commands


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

CLI commands for backing up mySQL database


Copy this code and paste it in your HTML
  1. -- dump mySQL database to file:
  2. VAR=$(date +�%y-%m-%d�); mysqldump -v -uUSERNAME -pPASSWORD -hlocalhost DATABASENAME > /BACKUPDIR/$VAR-DATABASENAME.sql ;
  3.  
  4. -- dump mySQL database to file and then move it:
  5. VAR=$(date +�%y-%m-%d�); mysqldump -v -uUSERNAME -pPASSWORD -hlocalhost DATABASENAME > /BACKUPDIR/$VAR-DATABASENAME.sql ; mv /BACKUPDIR/DATABASENAME.sql /OTHERBACKUPDIR/$VAR-DATABASENAME.sql ;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.