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 5.x | 64 bit | omvextrasorg 5.x | kernel 5.4
    used plugins: omv-extras | portainer | rsnapshot | antivirus
    used container: portainer/portainer | linuxserver/nextcloud | linuxserver/letsencrypt | linuxserver/mariadb | jellyfin/jellyfin | doliana/logitech-media-server | v2tec/watchtower | instrumentisto/coturn

  • 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 10 (Buster) - OpenMediaVault 5.2.12-1 Usul - Kernel 5.8.0-0.bpo.2-amd64 - CPU Intel Pentium G3460
    - NAS 2 : Debian 10 (Buster) - OpenMediaVault 5.2.12-1 Usul - Kernel 5.7.0-0 bpo.2-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 10 (Buster) - OpenMediaVault 5.2.12-1 Usul - Kernel 5.8.0-0.bpo.2-amd64 - CPU Intel Pentium G3460
    - NAS 2 : Debian 10 (Buster) - OpenMediaVault 5.2.12-1 Usul - Kernel 5.7.0-0 bpo.2-amd64 - CPU Intel Core 2 Duo E8400

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!