Daily error report with Anacron

  • Hello,


    I receive everyday an error report in my mailbox with the following content:



    Object:
    Cron <root@xxx> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )


    Code
    1. /etc/cron.daily/logrotate:
    2. mysqladmin: connect to server at 'localhost' failed
    3. error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    4. error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
    5. run-parts: /etc/cron.daily/logrotate exited with return code 1


    How can I correct this?
    Thank you for your help.


    I am using I-mscp 1.4.7 with Debian Jessie.

  • @darksk


    SQL server vendor and version in use?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @darksk


    Execute the following command:

    Shell-Script
    1. # grep -m 1 password /etc/mysql/debian.cnf | cut -d ' ' -f3

    then, copy the printed password and execute the following SQL queries:

    Shell-Script
    1. # mysqlMariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<password>' WITH GRANT OPTION;MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'127.0.0.1' IDENTIFIED BY '<password>' WITH GRANT OPTION;MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'::1' IDENTIFIED BY '<password>' WITH GRANT OPTION;MariaDB [(none)]> FLUSH PRIVILEGES;MariaDB [(none)]> \q;

    where <password> must be the password that you have copied.


    Once done, try to connect using the debian-sys-maint SQL user to be sure that all is working as expected:

    Shell-Script
    1. # mysql -u debian-sys-maint -p<password>

    where <password> must be the password that you have copied.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Thank you Nuxwin !


    For each of your grant command I have the message :

    Code
    1. Query OK, 0 rows affected (0.00 sec)


    But I tried to connect to the SQL server with the password and I can connect so I will check tomorrow if I still receveive the email.

  • For each of your grant command I have the message :


    Query OK, 0 rows affected (0.00 sec)

    That is expected ;)

    Thank you Nuxwin !

    You're welcome.
    Thread closed.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206