How To Backup Your MySQL Database Automatically?

by Dinesh 2014-07-09 18:36:53

Do you want to automatically backup your MySQL database? AutoMySQLBackup  is a simple script,  provides the basic tool (mysqldump) to perform database automatic backups.

AutoMySQLBackup with a basic configuration will create Daily, Weekly and Monthly backups of one or more of your MySQL databases from one or more of your MySQL servers.

1. Download AutoMySQLBackup and and place it into your /etc/cron.daily directory or your home directory.

2. Edit (at least) the following lines :-
USERNAME=dbuser (The user must have at least select privileges to the databases) PASSWORD=password
DBNAMES="DB1 DB2 DB3" (make sure to keep the quotes " " otherwise it won't work)

3. Make the file executable :- chmod u+rwx

4. Create the following directory./backups

5. That's it.. Now you can run it using the command line "./automysqlbackup.sh" or if it is in /etc/cron.daily it will run each day when cron runs.

Tagged in:

783
like
0
dislike
0
mail
flag

You must LOGIN to add comments