Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


error: error running shared postrotate script for /var/log/mysql.log /var/log/mysql/mysql.log


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

share|improve this question

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.


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


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.. – phoops May 17 '14 at 20:09
I have Ubuntu 15.10 and the /etc/mysql/debian.cnf file shows user root and password is empty. I mean there's no debian-sys-maint user. What would be the solution here? – aesede Apr 19 at 13:17

Your Answer


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.