Messages about failed logrotate task are received in Plesk on Ubuntu 18: 'Access denied for user 'root'@'localhost' (using password: NO)

Follow

Comments

17 comments

  • Avatar
    Unknown User

    Step 5 has typo (asterisk symbols were parsed as bold text):

    Should be:

    GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'PASSWORD';

    Instead of:

    GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON . TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'PASSWORD';

  • Avatar
    Duncan Mavuso

    Good Day

    The command on step 5 for MariaDB should be the following:

    GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'PASSWORD';

  • Avatar
    Ivan Postnikov

    Hello @Sage and @Duncan, thank you for notice.

    The article will be reviewed.

  • Avatar
    Markus Wernecke (Edited )

    Hi,
    I also use Ubuntu 18 with Plesk 17.8.11 and MariaDB 10.2.19. I receive the following message every day.
    Do you recommend me to do the same workaround? Or is it another problem with a different root cause?
    Lots of greets

    logrotate_script: line 2: [: /var/run/mysqld/mysqld.pid: binary operator expected

  • Avatar
    Alisa Kasyanova

    @Markus Wernecke
    Hi! Please check the "/etc/logrotate.d/mysql-server" file, if its content differs from the following, please change it accordingly:

    /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log {
    daily
    rotate 7
    missingok
    create 640 mysql adm
    compress
    sharedscripts
    postrotate
    test -x /usr/bin/mysqladmin || exit 0
    if [ -f `my_print_defaults --mysqld | grep -m 1 -oP "pid-file=\K.+$"` ]; then
    # If this fails, check debian.conf!
    mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log \
    flush-engine-log flush-general-log flush-slow-log
    fi
    endscript
    }

    Thanks!

  • Avatar
    Markus Wernecke

    Hi @Alisa Kasyanova,

    thanks a lot for help. Yes there is a difference: ..."pid-file=\K[^$]+"` ];... I changed it to your configuration. Do I have to apply this by a command? So I wait until script will be executed in a few hours. Lots of greets

  • Avatar
    Alisa Kasyanova

    @Markus Wernecke
    You're welcome!
    You may test whether it is ok now by running "/etc/cron.daily/logrotate". If you won't receive the same notification, then it is fine.

  • Avatar
    Markus Wernecke (Edited )

    Thanks a lot for your help. Sorry, I was not able to answer before. This error message doesn't appear anymore. But then, exactly the same day the error message from above in your tutorial appeared. Now I followed your helpful tutorial from above. Hope it works. Lots of greets and thanks for the great support.

    /etc/cron.daily/logrotate:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
    run-parts: /etc/cron.daily/logrotate exited with return code 1


  • Avatar
    Ivan Postnikov

    @Markus,

    Great to hear this helped.

    Thank you for letting us know.

  • Avatar
    Wolfgang Reidlinger

    Thanks for the workaround!
    Seams to work out for me.

    Just one note/question:
    Will it be fixed with the next update / does the next update reverse this workaround / or do I have to do the next workaround after the next update?

  • Avatar
    Ivan Postnikov

    Hello @Wolfgang,

    Glad to hear that workaround has helped.

    > Will it be fixed with the next update

    The bug will be fixed in the new Plesk version right at release but there is no exact date of release.

    Currently, there is no ETA  for backport to Plesk 17.8

    > does the next update reverse this workaround / or do I have to do the next workaround after the next update?

    Plesk update/upgrade does not modify the configuration changes of above workaround.

  • Avatar
    Joachim Weisse

    Hi,
    I also use Ubuntu 18 with Plesk 17.8.11 and MariaDB 10.2.19. I receive the following message after I follow your instructions above and as last try this:

    mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log

    I get this ERROR message on screen:

    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

    I checked the set PASSWORD (replaced with my password) this way:

    mysql -u debian-sys-maint -p
    Password: PASSWORD (replaced with my password)

    and I can login with debian-sys-maint without trouble in mysql - so I think this part will be ok.

     

    So you can give me any hint what I can do?
    Best regards

  • Avatar
    Alexandr Redikultsev

    Hi @Joachim Weisse,

    It should work in case you can access mysql with this user manually. Please double-check that there are no extra spaces in the password provided in the file after the password or try playing around with quotes.

  • Avatar
    Joachim Weisse

    I have double checked as I wrote above and yes I can login whith the user debian-sys-maint and password I have given. But logrotate does not work. I will try to make you a litle screen recorded video from...

  • Avatar
    Ivan Postnikov

    Hello @Joachim,

    Thank you for the comment.

    As an additional investigation is required, I would suggest submitting a support request. Usually, this allows to find the cause faster.

  • Avatar
    Marcel Klein (Edited )

    Hello,

    I've the same problem like Joachim after the workaround above:

    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

    Password is correct and I can login manually.

     

  • Avatar
    Alisa Kasyanova

    @Marcel Klein
    Please check the following article as well: https://support.plesk.com/hc/en-us/articles/213361889 Probably, there could be some password misconfiguration between the database and the file. If this won't help, feel free to submit a request as per https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-

Please sign in to leave a comment.

Have more questions? Submit a request