mysql启动报can't create/write to file 'var/run/mysqld/mysqld.pid 错误解决办法

时间:2021-05-02 00:31:48

msql启动报错,启动不了。

进入mysql日志默认的路径为 /var/log/mysqld.log 查看日志,发现报错信息如下:

can't create/write to file 'var/run/mysqld/mysqld.pid


解决办法:

将 /var/run/mysqld/权限赋给mysql 

执行以下命令即可:


chown -R mysql /var/run/mysqld
chgrp -R mysql /var/run/mysqld