So after having mysql setup and running properly for 6 months or so Ive started getting an error in /var/log/messages again. The error relates to logrotate and is
logrotate: error: 'Access denied for user 'root'@'localhost' (using password: YES)
in my /root/.my.cnf file
user = root
password = <password>
I can login to the server manually using mysql -u root -p and entering the password I have in the .my.cnf file. Anyone else experience this problem, and if so how did you manage to resolve it?
On 02/28/2011 05:36 PM, baaldemon wrote:
>
> in my /root/.my.cnf file
>
i wonder why i have an /etc/my.cnf but no /root/.my.cnf ??
–
DenverD
CAVEAT: http://is.gd/bpoMD
[NNTP posted w/openSUSE 11.3, KDE4.5.5, Thunderbird3.0.11, nVidia
173.14.28 3D, Athlon 64 3000+]
“It is far easier to read, understand and follow the instructions than
to undo the problems caused by not.” DD 23 Jan 11
The /etc/my.cnf version is used for the global settings, ~/.my.cnf is used to set user specific settings. logrotate runs as root so needs it needs the password to be set for that user, which is why im referencing /root/.my.cnf but for some reason it stopped doing it. However now that I look back through the messages in /var/log/messages and the timestamped mysql logs it doesnt appear to happen all the time, and at the times when I receive the message in the logs the files still seem to get rotated. So I guess its not a major problem, hardly use mysql other than for amarok, and its still rotating.
/etc/my.cnf is used for global settings as mentioned. You would never put a password in it because it is meant to be publicly readable as it contains settings for various programs like mysql, mysqladmin, etc. which could be invoked by normal users. Hence passwords go into /root/.my.cnf if the cron job is run as root, since this is root’s personal MySQL config file. But you have to make sure that the cron job has $HOME defined.
@baaldermon: “So I guess its not a major problem”…maybe right, but
it still might be something to log a bug on, it sure sounds strange to
me…i just hate intermittent little irritants which are not
explainable: http://en.opensuse.org/Submitting_Bug_Reports
–
DenverD
CAVEAT: http://is.gd/bpoMD
[NNTP posted w/openSUSE 11.3, KDE4.5.5, Thunderbird3.0.11, nVidia
173.14.28 3D, Athlon 64 3000+]
“It is far easier to read, understand and follow the instructions than
to undo the problems caused by not.” DD 23 Jan 11