Logrotate MySQL Cron Error

I have been receiving the following email report:

error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Most recommendations to fix this problem suggest updating the debian-sys-maint password for the MySQL server to match the one in /etc/mysql/debian.cnf.

This will not fix the problem if MySQL is not logging. Check if logging is turned on in /etc/mysql/my.cnf.

If you choose only to log errors then remove /etc/logrotate.d/mysql-server.

You should no longer get this error!!

One Reply to “Logrotate MySQL Cron Error”

  1. Hello, Hussein Bharwani,

    Thanks so much for posting this info. We are implementing your suggestion now. It was very helpful of you to post this.

Leave a Reply

Your email address will not be published. Required fields are marked *