Posts tagged with ‘backup mysql’

How to setup mysqldump without password in cronjob

advertisement

mysql, mysql databaseIf you execute mysqldump manually, mysqldump will prompt you for password. If you setup mysqldump via cronjob, you need to find a solution to disable the password. I’ve setup mysqldump to backup my db via cronjob without password. All you need to do is just to add a file in your home directory and it will disable the mysqldump password prompting.

To setup mysqldump without password in Cronjob, follow the steps below:-

Continue reading How to setup mysqldump without password in cronjob »

How to backup MySQL Database in command line with compression

advertisement

For those who looking for way to backup mysql database,
you can use mysqldump to backup mysql database.

Below is the script example to backup mysql database in command line:-

$ mysqldump -h localhost -u username -p database_name > backup_db.sql

If your mysql database is very big, you might want to compress your sql file.
Just use the mysql backup command below and pipe the output to gzip,
then you will get the output as gzip file.

Continue reading How to backup MySQL Database in command line with compression »