MySQL Forums
Forum List  »  Data Recovery

mysqlcheck: Error 1045 appears to ignore defaults file
Posted by: Charles Belov
Date: May 27, 2011 02:28PM

I had been running mysqlcheck successfully each night in cron, Now it has stopped running without my knowingly having changed anything.

Cron output:

Subject: Cron <{FreeBSD user name redacted}> /usr/local/bin/mysqlcheck --defaults-file=/root/.{FreeBSD user name redacted}_mysqlcheck.cnf {data base name redacted}

/usr/local/bin/mysqlcheck: Got error: 1045: Access denied for user
'{FreeBSD user name redacted}'@'localhost' (using password: NO) when trying to connect

Here are the permissions for the default file:

-rw------- 1 {FreeBSD user name redacted} {FreeBSD group name redacted} - 125 May 26 13:44 .{FreeBSD user name redacted}_mysqlcheck.cnf

Here's the content of .{FreeBSD user name redacted}_mysqlcheck.cnf:

[client]
user="{mySQL user name redacted}"
password="{mySQL user password redacted}"

[mysqlcheck]
analyze
auto-repair
force
host=localhost
optimize
verbose

Here's the strange part:

1. It is saying "(using password: NO)" in the error message even though the configuration file has a password specified.
2. It appears to be denying access to the FreeBSD user even though the configuration file specifies a different name for the mySQL user.
3. Another program, which uses its own proprietary format for its own configuration file, is continuing to run fine.

I have verified that the mySQL user name and the mySQL password are the same in both configuration files, and that both specify localhost. The respective cron jobs, which are run for the same FreeBSD user, specify the same database name.

FreeBSD 6
MySQL 5.0.24



Edited 1 time(s). Last edit at 05/27/2011 02:28PM by Charles Belov.

Options: ReplyQuote


Subject
Views
Written By
Posted
mysqlcheck: Error 1045 appears to ignore defaults file
4412
May 27, 2011 02:28PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.