Usr/bin/mysqladmin:refresh failed; Error: & #39; Unknown error& #39;

Source: Internet
Author: User
Tags log log iptables lost password

Debian wheezy upgrade, due to authorization errors, resulting in password to change, under the Debian MySQL safe also can not access.
I've changed the/etc/mysql/my.cnf inside. bind-address for LAN IP
And then run the
GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;
Then overload the authorization table:
FLUSH privileges;

Then after restarting, despite being able to remotely link, Debian itself reported a MySQL error.


/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 '
Run-parts:/etc/cron.daily/logrotate exited with return code 1


Saved 4 Messages In/home/tom/mbox


This issue is due to the first time the MySQL service started when the Mysql_safe error.log log file was created by root, mysqladmin call cron log cut to clear this log file without permission caused.

This bug has been fixed in the new Debian Sid, but the stable version number has not yet been received by this fix.

The workaround:

Again configure the MySQL error_log, inside the my.cnf. And let your MySQL have permission for this file.

-rw-r-----  1 root  adm      517639 [2014-07-01  9:26] Mysql_error.log

You can change the root to MySQL.

Chown Mysql/var/log/mysql/mysql_error.log




For centos6,7 remote connection failure issues, it is generally a newly installed server

No root password: mysqladmin-uroot password "Newpass"

already has root password: mysqladmin-uroot password ' oldpasswd ' newpasswd '

can also be directly logged into MySQL, mysql-u root;use MySQL; UPDATE user SET Password = Password (' newpass ') WHERE user = ' root '; FLUSH privileges;

Lost Password:mysqld_safe--skip-grant-tables& mysql-u root MySQL;

UPDATE user SET Password=password ("New password") WHERE user= ' root '; FLUSH privileges;


To authorize remote access to the user, first confirm the port [client] port=3307 [mysqld] port=3307 next to see if MySQL starts up, NETSTAT-ANP | grep 3307 See port occupancy

Then grant all privileges on * * to ' root ' @ '% ' identified by ' Your_password ' with GRANT option; FLUSH privileges;

Firewall open 3307 port, iptables-i input-p tcp-m State--state new-m TCP--dport7 -j ACCEPT

See if the rule is in effect, Iptables-l-N

Delete old rule iptables-d input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT

At the same time the firewall needs to save service iptables Save/etc/init.d/iptables Save

or directly change the vi/etc/sysconfig/iptables increase

-A input-p tcp-m state--state new-m TCP--dport 3307-j ACCEPT

This allows you to log in remotely.





Usr/bin/mysqladmin:refresh failed; error: & #39; Unknown error& #39;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.