Home >Database >Mysql Tutorial >usr/bin/mysqladmin: refresh failed; error: 'Unkn_MySQL

usr/bin/mysqladmin: refresh failed; error: 'Unkn_MySQL

WBOY
WBOYOriginal
2016-05-31 08:49:55982browse

debian wheezy 升级后, 因为授权错误, 导致密码给修改, 在debian的mysql safe下也无法进入.  
我在/etc/mysql/my.cnf 里面已经修改了bind-address 为局域网ip
进而执行了
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
然后重载授权表:
FLUSH PRIVILEGES;

然后重启后, 虽然可以远程链接, 但是debian 本身报了一个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


这个问题的产生是因为第一次mysql服务启动的时候mysql_safe的error.log日志文件是被root创建的, mysqladmin 调用cron的日志分割清除这个日志文件没有权限导致的.

这个bug已经在新点儿的debian sid里面修复了, 但是stable版本还没有接到这个fix.

解决办法:

重新配置下mysql的error_log , 在my.cnf里面. 并且让你的mysql对这个文件有权限.

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

修改root为mysql 就可以了

chown mysql /var/log/mysql/mysql_error.log



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn