MariaDB日志旋转错误

每天晚上,我从我的服务器收到一封电子邮件,内容如下:

/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.log /var/log/mysql/mysql.log /var/log/mysql/mariadb-slow.log ' run-parts: /etc/cron.daily/logrotate exited with return code 1 

我不知道这是为什么发生,我不知道如何停止错误。

有linux实用程序logrotate,它试图旋转mariadb的日志。

你应该看看文件:

 /etc/logrotate.conf 

寻找具有脚本的部分( 向您发送邮件 ),由:

 /var/log/mysql.log { ... ... ... } /var/log/mysql/mysql.log { ... ... ... } /var/log/mysql/mariadb-slow.log { ... ... ... } 

也许是因为没有input凭据。 如果不需要,可以删除这些脚本(散列它们),或者将login凭据提供给MariaDB。

希望能帮助到你!