Cron setup for Mysql automatic backup Linux

Cron setup for Mysql automatic backup Linux, Back upping MySql database is always a pain for some people.And, manual back upping procedure takes a lot of your time and effort.
So, here i am going to explain how to backup MySql database automatically to the cloud, without any cost.
It’s free…

Ok. Let’s start with mysqldump.

mysqldump

mysqldump is a a command line tool used to backup database.

To backup a mysql databse :

# mysqldump -u root -p[password] [database_name] > filename_todump.sql

To restore a mysql databse from command line use:

# mysql -u root -p[password] [database_name] < filename_dumpped.sql

The above command is will do the work. But, if you want to do more, explore mysqldump by yourself. It provides a various of options.The next thing we want to do is, to set this as a cron in your system.

Cron setting

To setup the above command as cron:

10 05 * * * root mysqldump -u root -p[password] [database_name] > /home/db_backup/database_name.sql.gz 

To setup cron for all the databases :

10 05 * * * root mysqldump -u root -pPASSWORD --all-databases | gzip > /home/db_backup/database_name.sql.gz 

Also, automysqlbackup is a tool, available in Github, which provides more specific options that will suit to your needs.

If you don’t know too much above cron job setting please visit this my this article :How to setup cron in Linux

It is also easy to push these saved database to cloud or a repository like Bitbucket or Github via a simple cron job.
I have give detailed review about that in the following link:Automatic Backup to Git repositary or Cloud

Note: Cron setup for Mysql automatic backup Linux is not only the way to backup mysql or any other database.It will be good to use the native functions to do the backup process.It, also reduces server load give a real advantage, sometimes.