获取错误:mysql,服务失败,因为控制进程退出,错误代码为,安装docker后

cygmwpex  于 2022-10-22  发布在  Mysql
关注(0)|答案(2)|浏览(473)

我已经在我的ubuntu 21系统上安装了MySQL服务器,当我尝试启动MySQL服务器时,我得到了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.,在我安装docker并在其上运行MySQL之前,它运行良好
systemctl状态mysql.service

mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset:>
     Active: failed (Result: exit-code) since Sat 2022-01-22 18:32:17 IST; 7min>
    Process: 19128 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=>
    Process: 19136 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
   Main PID: 19136 (code=exited, status=1/FAILURE)
     Status: "Server startup in progress"
      Error: 13 (Permission denied)
        CPU: 313ms

Jan 22 18:32:17 Lenovo systemd[1]: mysql.service: Scheduled restart job, restar>
Jan 22 18:32:17 Lenovo systemd[1]: Stopped MySQL Community Server.
Jan 22 18:32:17 Lenovo systemd[1]: mysql.service: Start request repeated too qu>
Jan 22 18:32:17 Lenovo systemd[1]: mysql.service: Failed with result 'exit-code>
Jan 22 18:32:17 Lenovo systemd[1]: Failed to start MySQL Community Server.

日志tl-xeu mysql.service

░░ Subject: A stop job for unit mysql.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A stop job for unit mysql.service has finished.
░░ 
░░ The job identifier is 6908 and the job result is done.
Jan 22 18:32:17 Lenovo systemd[1]: mysql.service: Start request repeated too qu>
Jan 22 18:32:17 Lenovo systemd[1]: mysql.service: Failed with result 'exit-code>
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit mysql.service has entered the 'failed' state with result 'exit-code>
Jan 22 18:32:17 Lenovo systemd[1]: Failed to start MySQL Community Server.
░░ Subject: A start job for unit mysql.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit mysql.service has finished with a failure.
░░ 
░░ The job identifier is 6908 and the job result is failed.
czfnxgou

czfnxgou1#

尝试以下命令

sudo mysqld_safe --defaults-file=/etc/my.cf

sudo chown -R mysql:mysql /var/lib/mysql

有时对于某些系统,当你给出下面两个命令时,它会显示不是一个目录,如果它显示的话,就把下面的两个命令切掉,然后执行下一个命令。

/etc/init.d/mysqld start

/etc/init.d/mysqld stop

最后,尝试以下命令

sudo systemctl restart systemd-logind

systemctl重新启动后,系统有时会挂起并注销。如果已注销,请再次登录并
运行sudo systemctl start mysql.service,它将正常工作。
有关更多命令,请检查链接here,如果上面的命令不适用,请检查该网站上的以下命令

ryevplcw

ryevplcw2#

我也试了一下,得到了这个:

systemctl status mysql.service
× mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2022-10-17 22:38:59 CEST; 1min 40s ago
    Process: 17421 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
        CPU: 8ms

Okt 17 22:38:59 install-web systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Okt 17 22:38:59 install-web systemd[1]: Stopped MySQL Community Server.
Okt 17 22:38:59 install-web systemd[1]: mysql.service: Start request repeated too quickly.
Okt 17 22:38:59 install-web systemd[1]: mysql.service: Failed with result 'exit-code'.
Okt 17 22:38:59 install-web systemd[1]: Failed to start MySQL Community Server.

我已经重新安装了,但没有帮助。

相关问题