The mysql tool-the second version is in the first version (see www.linuxidc.comlinux2011-1046306.htm. Main
MySQL automatic backup tool under Linux-the second version of the first version (see the http://www.linuxidc.com/Linux/2011-10/46306.htm) on the basis of the program has been improved. Main
MySQL automatic backup tool in Linux-the second version is well developed based on the first version (see. It mainly includes custom database hosts and Backup Paths. Multiple databases can be backed up, regardless of the number of databases. You can choose whether to enable expired backup deletion and customize the expiration time. And added more friendly prompts.
Backup Tool usage:
1. Upload mysql. backup (or save the code as mysql. backup) to the Linux Server/usr/local/sbin directory and grant the executable permission.
2. Use vi to open the script and configure the database information. Configure the following information:
Mysql_user = "root" # MySQL backup user
Mysql_password = "root" # password of the MySQL backup user
Mysql_host = "localhost" # host to be backed up, generally localhost
Mysql_port = "3306" # MySQL port number, usually 3306
Backup_db_arr = ("dbachina" "99 yuyu" "cowaw") # Name of the database to be backed up. Separate multiple database names with spaces, for example ("db1" "db2" db3 ")
Backup_location =/backup # backup data storage location. do not include "/" at the end. This option can be used by default. The program will automatically create folders.
Expire_backup_delete = "ON" # Whether to enable expired backup deletion ON whether to enable OFF or disable
Expire_days = 3 # The default expiration time is three days. This option is only valid when expire_backup_delete is enabled.
Save the configuration and exit.
3. Run mysql. backup at any time to perform the backup operation.
4. Automatic Backup
You can use the Linux crontab timing function to complete automatic backup.
In Linux, type crontab-e
Enter 30 02 ***/usr/local/sbin/mysql. backup to save and exit.
You can automatically back up all databases at 02:30 every day.
Script download:
Free on
Both the user name and password are
Download the MySQL automatic backup tool in the/pub/2011/10/31/Linux directory-Version 2/
Shows the backup effect: