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文件夹做一个初始化:

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