daily mail with cron failed

  • everyday i have a mail with foloing message:


    Code
    /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

    what does it meen?
    What can i do?
    Thanks!

    omv 6.x | 64 bit | omvextrasorg 6.x |
    used plugins: omv-extras | portainer | rsnapshot | antivirus
    used container: portainer/portainer | nextcloud/all-in-one | linuxserver/swag | paperless-ngx | jellyfin/jellyfin | lmscommunity/logitechmediaserver | adguard/adguardhome |

  • Hello,


    I have mostly the same error message each day in my inbox mail folder.

    Code
    /etc/cron.daily/logrotate:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    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


    How to solve this ?

    - NAS 1 : Debian 11 (bullseye) - OpenMediaVault 6.9.11-3 Shaitan - Kernel 6.1.0-0.deb11.13-amd64 - CPU Intel Pentium G3460 @ 3.50GHz

    - NAS 2 : Debian11 (bullseye) - OpenMediaVault 6.9.11-3 Shaitan - Kernel 6.1.0-0.deb11.13-amd64 - CPU Intel Core 2 Duo E8400

  • Missing debian maintenance user is the culprit (I guess). To fix it you need to edit
    /etc/mysql/debian.cnf


    It should look like


    [client]
    host = localhost
    user = debian-sys-maint
    password = SECRET_PASSWORD
    socket = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host = localhost
    user = debian-sys-maint
    password = SECRET_PASSWORD
    socket = /var/run/mysqld/mysqld.sock


    I had as user debian and no password also I had an additonal line
    basedir = /usr
    but that line seems to be OK. The user debian I've changed two times to debian-sys-maint and I added a password (again two times)



    then (if your mysql root user is still omvadmin, otherwise change to your root user below)


    mysql -u omvadmin -p



    now enter your mysql rootusers password and execute these three commands (each line is a single command)



    Code
    CREATE USER IF NOT EXISTS 'debian-sys-maint'@'localhost' IDENTIFIED BY 'SECRET_PASSWORD';
    GRANT ALL ON *.* TO 'debian-sys-maint'@'localhost' WITH GRANT OPTION;
    FLUSH PRIVILEGES;

    Replace SECRET_PASSWORD with the one you set above in /etc/mysql/debian.cnf


    You'll create a new mysql user and create the necessary privileges for it.


    That's it

  • Ok, thanks alot @Stramm. I'm not at home right now but will do as you told me and hope to solve this. ;)

    - NAS 1 : Debian 11 (bullseye) - OpenMediaVault 6.9.11-3 Shaitan - Kernel 6.1.0-0.deb11.13-amd64 - CPU Intel Pentium G3460 @ 3.50GHz

    - NAS 2 : Debian11 (bullseye) - OpenMediaVault 6.9.11-3 Shaitan - Kernel 6.1.0-0.deb11.13-amd64 - CPU Intel Core 2 Duo E8400

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!