欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

service mysql start 报错总结

程序员文章站 2022-07-10 20:20:08
...

在linux上安装mysql后 启动mysql,或者在使用mysql过程中启动mysql 可能出现以下错:

常见错误以下三种,可循环解决! 让报错无所遁形!!!

报错一:

ERROR! MySQL is running but PID file could not be found

1.先打印MYSQL进程

ps aux | grep mysql

2.然后Kill进程

kill -9 pid1 pid2 …

3.再启动MYSQL

/etc/init.d/mysql start

4.再检查mysql运行状态

/etc/init.d/mysql status

报错二:

Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/hadoop01.pid).

1 . ps -ef | grep mysql

kill -9 PID

2 . ls -laF /usr/local/var/mysql/

前两步如果不奏效,请直接执行更改当前用户权限:

sudo chown -R hadoop.hadoop /var/lib/mysql

3.再启动MYSQL

/etc/init.d/mysql start

4.再检查mysql运行状态

/etc/init.d/mysql status

报错三:

ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists

之后保存再重启还是出错。
最后检查可能和log文件有关,于是将log文件给移除了,再重启MySQL终于OK了。

1./etc/init.d/mysql status

coming back with:
mysql is not running but lock exists
Solved by removing the lock file:

2.rm /var/lock/subsys/mysql

If this happens again it may also be necessary to remove the pid file from /var/lib/mysql

原文链接:https://blog.csdn.net/young_0609/article/details/78062050