Close

Not a member yet? Register now and get started.

Support Center » Downloads » How to e-mail yourself an automatic backup of your MySQL database table with PHP
 How to e-mail yourself an automatic backup of your MySQL database table with PHP
Description This script will send an e-mail to you with an .sql file attached, thus enabling you to back up specific tables easily. If you have a database-driven site, your mysql info is what is most valuable to you! You could even set up an e-mail account just to receive these backups…

First of all, this script works best if you place it in a non-web accessible folder and run a daily cron job on it. Cron is a server “tool” that can run scripts regularly or at specified times (thus you don’t need to call them in your browser). I used to be scared of cron but it’s really easy. Here are two tutorials if you are interested Cron Tutorial 1 … Cron Tutorial 2. If you have cPanel on your server it’s even easier (see here).

The code is below, and requires the Pear Mime and Pear Mail packages. If you want to download everything at once, I have provided a zip file at the end of this post.

Known limitations of this script: if you have a big database table over 2mb, you will probably run into php timeouts and php mail attachment limits. Check this comment for information about compressing the backup file before sending or storing it.

http://www.theblog.ca/mysql-email-backup

Alternatives:http://www.dagondesign.com/articles/automatic-mysql-backup-script/#logging


Download Details
Filename: mysqlbackup.zip
Total Downloads: 47
Size: 36.38 KB
# Comments:0
Creation Date:16 Nov 2009 8:05 PM
Modified: 16 Nov 2009 8:06 PM

 Login [Lost Password] 
E-mail:
Password:
Remember Me:
 
 Search
 Download Options