如何修复“mysql.service 作业失败,因为控制进程以错误代码退出”

如何修复“mysql.service 作业失败,因为控制进程以错误代码退出”

当我尝试使用命令使用 mysql 客户端时mysql,我得到:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

然后我尝试使用启动该服务service mysql start,得到以下信息:

Job for mysql.service failed because the control process exited with error code. 
See "systemctl status mysql.service" and "journalctl -xe" for details.

当我跑步时systemctl status mysql.service我得到:

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-06-15 15:28:52 -03; 4min 2s ago
  Process: 4405 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)

jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: Stopped MySQL Community Server.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Start request repeated too quickly.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Failed with result 'exit-code'.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: Failed to start MySQL Community Server.

journalctl -xe说:

-- 
-- Unit mysql.service has failed.
-- 
-- The result is RESULT.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit mysql.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has finished shutting down.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Start request repeated too quickly.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: mysql.service: Failed with result 'exit-code'.
jun 15 15:28:52 Aspire-VN7-572 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has failed.
-- 
-- The result is RESULT.
jun 15 15:33:10 Aspire-VN7-572 systemd-resolved[713]: Grace period over, resuming full feature set (UDP+EDNS0) for DNS server 200.114.120.9.
jun 15 15:33:10 Aspire-VN7-572 systemd-resolved[713]: Using degraded feature set (UDP) for DNS server 200.114.120.9.
jun 15 15:33:34 Aspire-VN7-572 systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit systemd-tmpfiles-clean.service has begun starting up.
jun 15 15:33:34 Aspire-VN7-572 systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit systemd-tmpfiles-clean.service has finished starting up.
-- 
-- The start-up result is RESULT.
jun 15 15:35:16 Aspire-VN7-572 wpa_supplicant[768]: wlp3s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-59 noise=-112 txrate=1000

相关内容