Results 1 to 7 of 7

Thread: mysql logrotate and root password

  1. #1

    Default mysql logrotate and root password

    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
    Code:
    logrotate: error: 'Access denied for user 'root'@'localhost' (using password: YES)
    in my /root/.my.cnf file
    Code:
    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?

    Thanks

  2. #2
    Join Date
    Aug 2008
    Location
    Behind the 8 ball
    Posts
    116

    Default Re: mysql logrotate and root password

    Double check your /root/.my.cnf file, it should have the [mysqladmin] directive

    Code:
    [mysqladmin]
    password = <secret>
    user= root

  3. #3

    Default Re: mysql logrotate and root password

    It does, forgot to copy that part in, sorry for the confusion

  4. #4
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: mysql logrotate and root password

    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

  5. #5

    Default Re: mysql logrotate and root password

    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.

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: mysql logrotate and root password

    Quote Originally Posted by DenverD View Post
    i wonder why i have an /etc/my.cnf but no /root/.my.cnf ??
    /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.

  7. #7
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: mysql logrotate and root password

    thanks both for adding to my education...

    @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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •