Automysqlbackup: Cannot Use Root Credentials From MySQL CLI

 1[root@rh icasimpan]# /usr/local/bin/automysqlbackup /etc/automysqlbackup/rh.conf
 2Parsed config file "/etc/automysqlbackup/automysqlbackup.conf"
 3 
 4# Checking for permissions to write to folders:
 5base folder /var/lib ... exists ... ok.
 6backup folder /var/lib/automysqlbackup ... exists ... writable? yes. Proceeding.
 7checking directory "/var/lib/automysqlbackup/daily" ... exists.
 8checking directory "/var/lib/automysqlbackup/weekly" ... exists.
 9checking directory "/var/lib/automysqlbackup/monthly" ... exists.
10checking directory "/var/lib/automysqlbackup/latest" ... exists.
11checking directory "/var/lib/automysqlbackup/tmp" ... exists.
12checking directory "/var/lib/automysqlbackup/fullschema" ... exists.
13checking directory "/var/lib/automysqlbackup/status" ... exists.
14 
15# Testing for installed programs
16mysql ... found.
17mysqldump ... found.
18gzip ... found.
19 
20# Parsing databases ... Note: Parsed config file /etc/automysqlbackup/rh.conf.
21Error: The mysql server is empty, i.e. no databases found. Check if something is wrong. Exiting.
22 
23###### WARNING ######
24Errors reported during AutoMySQLBackup execution.. Backup failed
25Error log below..
26ERROR 1045 (28000): Access denied for user '"root"'@'localhost' (using password: YES)

Solution: Check the last line of the error message above. Notice that user is inside strange quotes.

1'"root"'

In /root/.my.cnf:

1[root@rh icasimpan]# cat /root/.my.cnf
2[client]
3user="root"
4password="root"

Remove the double quotes and try again. Per experience, it works most of the time.