服务器集群异常关机后,mysql启动失败
服务器非正常关机会导致mysql无法正常启动
现象描述:
1. service mysql status
mysql is not running but lock file ()failed
2. pa aux | grep mysql
无进程信息
3.mysql目录下面的tmp丢失
err文件出现:
2017-03-08 16:19:37 35480 [ERROR] Failed to open log (file '2017-03-08 11:57:02 4934 [Warning] 'proxies_priv' entry '@ root@FAN001' ignored in --skip-name-resolve mode.', errno 2)
2017-03-08 16:19:37 35480 [ERROR] Could not open log file
2017-03-08 16:19:37 35480 [ERROR] Can't init tc log
2017-03-08 16:19:37 35480 [ERROR] Aborting
解决方法:
1. 进入/data/mysql目录
2. 创建tmp文件夹
3. 清除mysql-bin.index 文件中的错误内容,(做好备份)
# cat mysql-bin.index
--skip-name-resolve mode.
2017-03-08 11:57:02 4934 [Warning] 'proxies_priv' entry '@ root@FAN001' ignored in --skip-name-resolve mode.
2017-03-08 11:57:03 4934 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not
# cp mysql-bin.index mysql-bin.index-bak
# vi mysql-bin.index
2017-03-08 11:57:02 4934 [Warning] 'proxies_priv' entry '@ root@FAN001' ignored in --skip-name-resolve mode.
4.重启mysql服务
# crm resource restart mysql
INFO: ordering mysql to stop
INFO: ordering mysql to start
# service mysql status
MySQL running (38756) [ OK ]