Mysql – debian thesql error running shared postrotate script for /var/log/thesql.log

debianMySQL

/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

run-parts: /etc/cron.daily/logrotate exited with return code 1

Best Answer

The shared postrotate script tries to access the mysql database but fails to do so, probably because the password doesn't match.

In Debian, mysql is controlled via the mysql user 'debian-sys-maint'@'localhost'. The password for this user is stored in /etc/mysql/debian.cnf.

cat /etc/mysql/debian.cnf

Note the password being used in this file. If you have a password for root (like you should), you will need to get into mysql with the following command.

mysql -u root -p

Otherwise, you can just type 'mysql'. In the mysql> prompt, run the following.

GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'XXXXXXXXXXXX';

Substitute the password found in /etc/mysql/debian.cnf in place of the Xs. And finally...

quit

You should now be able to restart your mysql server with no errors using the command:

/etc/init.d/mysql restart

However, the restart is not required.

Related Topic