mysqldump fails during backup

I imported 2 domains from cpanel backup files and all seems to be OK except one database from one server which causes the back up to fail. The error is as follows when run manually or on schedule.

Starting backup of 1 domains to local file /home/nic/backup/%c.tgz ..

Creating backup for virtual server ........ Copying virtual server configuration .. .. done - snip -

Dumping MySQL database adamfost_database ..
.. dump failed!

mysqldump: Got error: 1045: "Access denied for user 'root'@'localhost' (using password: YES)" when trying to connect

Backup failed! See the progress output above for the reason why.

when I run mysqldump -u root -p adamfost_database > test.sql from command line it works fine.

Any suggestions?

Status: 
Active

Comments

Does that user by chance have a .my.cnf file in their home directory? If so, it's possible that's causing the wrong information to be used during the backup process.

Thanks, that was it. You are the guru.

Cheers

Nic

Great, I'm glad that resolved it! I'll go ahead and mark this as fixed. Feel free to let us know if you have any additional questions!