Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

/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

share|improve this question

1 Answer 1

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.

share|improve this answer
    
Thanks me, this information is available on the internet, but the most popular post says to put the phrase IDENTIFIED BY PASSWORD in the mysql command instead of just IDENTIFIED BY. –  Chris H. Oct 27 '11 at 1:21
    
Your welcome other me. The crazy thing is that when you do use IDENTIFIED BY PASSWORD 'testpass', mysql will actually set the user's password to 'testpass' in plain text! Making the actual password readable to anyone who has read access to the 'mysql' table. This is clearly not good. So thank you for posting this question, it needed to be cleared up. –  Chris H. Oct 27 '11 at 1:26
    
what is this I don't even.. –  edvinas.me May 17 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.