Dec 6 09:05:01 hhh CRON[14216]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Dec 6 09:05:33 hhh systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Dec 6 09:05:33 hhh systemd[1]: mysql.service: Failed with result 'exit-code'.
Dec 6 09:05:33 hhh systemd[1]: Failed to start MySQL Community Server.
Dec 6 09:05:33 hhh systemd[1]: mysql.service: Scheduled restart job, restart counter is at 8.
Dec 6 09:05:33 hhh systemd[1]: Stopped MySQL Community Server.
Dec 6 09:05:33 hhh systemd[1]: Starting MySQL Community Server...
看上面日志主要是 mysql.service: Failed with result 'exit-code'. 的报错
还有这个报错也是一样的解决方法
service mysql start
# 输出结果
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.
journalctl -xeu mysql.service
# 输出结果
Dec 08 09:45:41 hhh systemd[1]: mysql.service: Failed with result 'signal'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit mysql.service has entered the 'failed' state with result 'signal'.
问题发生原因:
使用ps -e | grep mysql
查看MySQL相关进程时,看到多个MySQL进程,但是好像正常的进程只要mysql、mysqld
这两个(这个是在正常启动后查看的),在这多个进程里或许就有某一个进程阻碍了MySQL的启动,就是会有冲突,但是具体是什么冲突还不清楚。这个原因也只是我的猜测,做个参考就好
解决方法:
注:此方法是建立在配置文件没有错误的情况下,所以需要先查看配置文件是否正常配置
# 先查看MySQL进程
ps -e | grep mysql
# 结束进程,要全部kill掉,如果遇到kill不掉的就先不管,先试试能不能重启成功
kill -9 1234
# 重启服务
service mysql start
# 查看MySQL状态
systemctl status mysql