abronow
By:
abronow

Shared postrotate script failing

June 17, 2014 4.9k views
My server just started emailing this
etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
I don't know if it's a permissions issue. Any advice?
2 Answers
This can happen if the password for the debian-sys-maint MySQL user is wrong. If you look at the /etc/logrorate.d/mysql-server script it calls mysqladmin:
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
Check the password with:
cat /etc/mysql/debian.cnf
Then make sure it is correct by logging in mysql with the root user and running:
GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'REPLACE_WITH_REAL_PASSWORD';

I get:

Query OK, 0 rows affected (0.00 sec)

it shoud be 1 row affected, right?

Have another answer? Share your knowledge.