17 Jun 2008

MySQL Export and Email Backup

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 and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

One Response to “MySQL Export and Email Backup”

[...] wrote a post about backing up databases to email a while ago, but didn’t really explain what could be [...]

Leave a Reply