Yikes! Something strange in a cron job.
jonathan at bluesunhosting.com
Sat Feb 8 14:49:00 MST 2014
On Sat, Feb 8, 2014 at 12:10 PM, S. Dale Morrey <sdalemorrey at gmail.com>wrote:
> I added a MAILTO in crontab so I get a "crons eye view" of why I'm not
> getting my backup file and I get this error.
> mysqldump: Got error: 1045: Access denied for user 'root'@'localhost'
> (using password: NO) when trying to connect
> What's strange about this error is that it's coming from a script called by
> crontab, that runs perfectly fine as root.
> That is interesting. The error is a mysql error. The 'root' user is the
mysql user. It is complaining that there is no password being specified
when invoking the mysqldump command. Is the script using environment
variables to supply the password? If so, I am not sure what the behavior is
for cron in relation to loading user config files (eg bashrc and profile).
More information about the PLUG