安装MySQL出现Job for mysqld.service failed because the control process exited with error code问题

原文链接:https://blog.csdn.net/aiyowei1106/article/details/88703746

阿里云服务器在安装MySQL启动失败:
在这里插入图片描述
根据这个提示,查看原因,百度到的办法是,修改配置文件后,还是报错“Job for mysqld.service failed because the control process exited with error code”。

之后发现这一个问题(红框里面的提示,一开始就忽略了。。。导致走弯路),开始根据这个提示来寻找办法:
安装MySQL出现Job for mysqld.service failed because the control process exited with error code问题_第1张图片

修改配置文件,尝试之后,并不能解决问题。然后有寻找到下面这个方法,杀进程~~~
安装MySQL出现Job for mysqld.service failed because the control process exited with error code问题_第2张图片还是无果,哈哈哈哈…最后查看日志,发现是因为没有下面这个表,需要对MySQL文件夹做一个初始化:
安装MySQL出现Job for mysqld.service failed because the control process exited with error code问题_第3张图片安装MySQL出现Job for mysqld.service failed because the control process exited with error code问题_第4张图片提示不能初始化,最后发现是/var/lib/mysql /这个目标路径已经存在/var/lib/mysql /,导致无法初始化。解决办法:
安装MySQL出现Job for mysqld.service failed because the control process exited with error code问题_第5张图片

删除/var/lib/mysql /后重启MySQL服务就可以了!
安装MySQL出现Job for mysqld.service failed because the control process exited with error code问题_第6张图片

你可能感兴趣的:(Linux)