ERROR! MySQL server PID file could not be found!的解决方法

启动MySQL服务

[root@test vhosts]# /etc/init.d/mysqld restart

提示错误:

ERROR! MySQL server PID file could not be found!
Starting MySQL... ERROR! The server quit without updating PID file (/alidata/server/mysql/data/test.pid).

在/alidata/server/mysql/data目录下创建test.pid 文件并给相应的权限,文本给一个未使用的PID数字的值,然后再重新启动MySQL服务。

如果启动MySQL服务的时候发现该文件已被删除,则可以使用一下命令启动,

/alidata/server/mysql/bin/mysqld --basedir=/alidata/server/mysql --datadir=/alidata/server/mysql/data/

启动之后,会提示权限错误,不用管它,在查看MySQL进程的时候会发现MySQL已成功启动。

原文地址:https://www.cnblogs.com/rnckty/p/5157521.html