MySQL Export and Email Backup
Jun 17th, 2008 by Ben
I installed this line of code in a crontab the other day. It exports the entire database (schema and data) to text, then emails it to you. Makes backing up easy.
mysqldump -h DB-SERVER -u DB-USERNAME –password=”DB-PASSWORD” DB-NAME | mail -s mysqlExport EMAIL-ADDRESS
To use, replace the fields (in caps) with your database info and run in a crontab.
| Share This |



