centos7 mysql The server quit without updating PID file(错误解决)

1 问题

[root@localhost mysql]# /etc/rc.d/init.d/mysql status

MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]

[root@localhost mysql]# /etc/rc.d/init.d/mysql start

Starting MySQL…The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).                              [FAILED]

2 原因

没有初始化权限表

3 解决办法

#cd /usr/local/mysql(进入mysql安装目录)

#chown -R mysql:mysql  .

$scripts/mysql_install_db

4 本人解决过程

[root@localhost ~]#cd /usr/local/mysql

[root@localhost mysql]#chown -R mysql.mysql .

[mysql@localhost mysql]$scripts/mysql_install_db

[mysql@localhost mysql]$/usr/local/mysql/bin/mysqld_safe –user=mysql &

然后/tmp 目录下就出来了mysql.sock文件,运行service mysqld start

mysql服务启动成功。

借鉴文章:http://blog.csdn.net/caiyaodeng/article/details/45937183

这个问题也是困恼了我一个下午,终于通过这篇文章解决了,其中原理不是很懂,有什么不对的地方,请各位大佬指教。

    原文作者:消息_不见了
    原文地址: https://www.jianshu.com/p/5032d753b507
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞