怎么解决MySQL server PID file could not be found问题

本篇内容介绍了“怎么解决MySQL server PID file could not be found问题”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

root@s1 Downloads]# service mysql restart
MySQL server PID file could not be found!                  [FAILED]

[root@s1 Downloads]# service mysql stop
MySQL server PID file could not be found!                  [FAILED]


解决方法:
1.通过ss -tnl命令查看服务
[root@s1 Downloads]# ss -tnl
State       Recv-Q Send-Q   Local Address:Port   Peer Address:Port
LISTEN      0      50               *:3306                 *:* 
2,停止mysql服务
[root@s1 Downloads]# killall mysqld

3.重启mysql服务
4.发现mysql数据目录权限异常
[root@s1 Downloads]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
5.修改mysql数据目录权限
[root@s1 Downloads]# chown -R mysql.mysql /var/lib/mysql/

6.重启服务,即可以正常登陆mysql

“怎么解决MySQL server PID file could not be found问题”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!