Recent Posts

MySQL Export and Email Backup

Posted: June 17th, 2008 | Author: Ben | Filed under: Uncategorized |

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.

It's good to share:
  • Digg
  • TwitThis
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Slashdot
  • Reddit
  • Google
  • Fark
  • E-mail this story to a friend!

One Comment on “MySQL Export and Email Backup”

  1. #1 Brandnoo. A Blog by Ben Hindmarch » Blog Archive » Use Gmail for free and easy database backups said at 3:46 pm on November 3rd, 2008:

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


Leave a Reply