Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: mysqladmin: refresh failed; error: 'Unknown error'

Tags:

mysql

My problem started when I was tired to get emails every day from Cron Daemon. The emails look like this:

From: Cron Daemon <[email protected]>
Date: 2014-08-25 6:29 GMT+03:00
Subject: Cron <root@xxx> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
To: [email protected]


/etc/cron.daily/logrotate:
/usr/bin/mysqladmin: refresh failed; error: 'Unknown error'
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 have 40 emails like this in my inbox. A method that I found it's said that the problem comes from the fact that password debian.cnf not corspunde with another password. So I tride this in mysql console:

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

After this I did this check:

 $ mysqladmin --defaults-file=/etc/mysql/debian.cnf ping

result:

mysqld is alive

Ok, but the emails stil not stoped. So when I run:

$ mysqladmin -u root -p flush-log

result:

mysqladmin: refresh failed; error: 'Unknown error'

So, how can I debug this, any ideas?

UPDATE: This is a bug, from what I read. I suggest to let it go and make an update to mysql-server and mysql-client. Cheers!

$ sudo apt-get install mysql-server-5.6 mysql-client-5.6
like image 902
Francisc Avatar asked Aug 25 '14 16:08

Francisc


1 Answers

I had the same error. The solution was to fix permissions of log directory & files:

sudo chown -Rv mysql /var/log/mysql

The update/reinstall helped you probably because the mysql install script fixed the permissions for you.

like image 163
wanson Avatar answered Nov 15 '22 13:11

wanson