启动Mysql时发生的一个关于PID文件错误问题

时间:2021-12-26 15:49:48
 
今天启动mysql时出现了如下错误:
[root@host1 /]# service mysql start
Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/host1.pid).
查看错误日志:
[root@host1 /]# cat /var/log/mysqld.err | less
-- :: [ERROR] MYSQL_BIN_LOG::open_purge_index_file failed to open register file.
-- :: [ERROR] MYSQL_BIN_LOG::open_index_file failed to sync the index file.
-- :: [ERROR] Aborting
经排查,原因是文件权限在复制移动时被改动到了,属权限的问题,执行:
[root@host1 /]# chown -R mysql:mysql /var/lib/mysql/

[root@host1 /]# service mysql start
Starting MySQL.. SUCCESS!

问题成功解决。