I'm not sure if this is the right category for this, i couldn't see a better titled one..
I am trying to set up a cron job to automatically backup my mysql databases. After viewing many examples and tutorials i finally managed to get beyond the point of it rejecting my command or failing to connect, this is what i had:
With my password/username, etc... ***'d out
nice -n 15 /usr/bin/mysqldump --opt -u *** -p*** ¦ gzip > /home/***/backups/mysqlbackup_`date +\%d\%m\%y`.sql.gz
And i got this response from the automated email:
mysqldump: Got error: 1044: Access denied for user '***r'@'localhost' to database '?' when selecting the database
So i tried adding --all-databases to it, but wasn't sure where to put it, ended up with this:
nice -n 15 /usr/bin/mysqldump --opt -u *** -p*** --all-databases ¦ gzip > /home/***/backups/mysqlbackup_`date +\%d\%m\%y`.sql.gz
But now it doesn't seem to be running, as i'm not getting the email.
Could anyone tell me where i'm going wrong? Thanks.
mysql dump - cron job
Started by zaphe87, Apr 04 2009 09:10 AM
3 replies to this topic
#1
Posted 04 April 2009 - 09:10 AM
|
|
|
#2
Guest_Jordan_*
Posted 07 April 2009 - 01:33 PM
Guest_Jordan_*
Can you login to mysql command using the same username/pass? Just type mysql -u <username> -p
#3
Posted 09 April 2009 - 05:45 AM
The username and password are correct, it just don't know where to tell it which databases to dump.
#4
Guest_Jordan_*
Posted 09 April 2009 - 06:33 AM
Guest_Jordan_*
--all-databases will dump ALL databases. I'm not familiar with the nice command, what does it do? Does running this manually work (not in cron)?
?
If you look here: MySQL :: MySQL 5.1 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program
and scroll to the bottom you can find many user contributed mysql dump/backup scripts.
/usr/bin/mysqldump --opt -u *** -p*** --all-databases > allbackups.sql
?
If you look here: MySQL :: MySQL 5.1 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program
and scroll to the bottom you can find many user contributed mysql dump/backup scripts.


Sign In
Create Account

Back to top









