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

时间:2024-04-04 21:59:56

阿里云服务器在安装MySQL启动失败:

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

根据这个提示,查看原因,百度到的办法是,修改配置文件后,还是报错“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问题

修改配置文件,尝试之后,并不能解决问题。然后有寻找到下面这个方法,杀进程~~~

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

还是无果,哈哈哈哈..........最后查看日志,发现是因为没有下面这个表,需要对MySQL文件夹做一个初始化:

安装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问题

提示不能初始化,最后发现是/var/lib/mysql /这个目标路径已经存在/var/lib/mysql /,导致无法初始化。解决办法:

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

删除/var/lib/mysql /后重启MySQL服务就可以了!

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