How to Backup your MySQL DB databases

Backup command for mysql databases

For those looking to get a regular backup of your MySQL database, the command to add as a cron.job ...

/usr/bin/mysqldump -u{mysql_username} -p{mysql_password} {mysql_db_name} |gzip |uuencode {mysql_db_name}backup.sql.gz |mail -s "database backup" {emailaddress}

replace :

  • {mysql_username} with the database owner username
  • {mysql_password} with the database password
  • {mysql_db_name} with the database name
  • {emailaddress} with your email address

Please only add the backups as jobs *after* 2am to keep load down on the server duriung peak hours, and be warned it will use up your bandwidth/data-transfer allocation quickly, so weekly backups are recommended over daily ones if your DB is relatively static.

  • 9 Users Found This Useful
這篇文章有幫助嗎?

相關文章

How do I create a MySQL database in Cpanel ?

MySQL databases can be created through the cpanel control panel: Login to your control panel...

How do I create a MySQL database in Plesk ?

MySQL databases can be created through the plesk control panel: Login to your control panel...

How do I repair a damaged MySQL table, rebuild index or prepare for backup ?

It is always worth trying a repair of MySQL tables before backing them up to shrink the...

How do I create a MySQL Database in the Ensim control panel ?

To add a database (subject to hosting plan resources available) through your Ensim control panel:...

How do I move a MySQL Database from one host to another using phpMyAdmin ? Backup and Restore using phpMyAdmin.

How to Backup and Restore your MySQL Database using phpMyAdmin The following are the steps to...

Powered by WHMCompleteSolution