繁体   English   中英

MySQL “启动”在 ubuntu 20.04 中失败

[英]MySQL “start” fails in ubuntu 20.04

我尝试运行命令:

sudo systemctl start mysql

并收到以下消息:

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

然后当我输入:

sudo 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 Tue 2021-03-02 11:32:34 IST; 58s ago
    Process: 3383 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)

Mar 02 11:32:34 avivilloz systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Mar 02 11:32:34 avivilloz systemd[1]: Stopped MySQL Community Server.
Mar 02 11:32:34 avivilloz systemd[1]: mysql.service: Start request repeated too quickly.
Mar 02 11:32:34 avivilloz systemd[1]: mysql.service: Failed with result 'exit-code'.
Mar 02 11:32:34 avivilloz systemd[1]: Failed to start MySQL Community Server.

我搜索了几个小时,但找不到解决方案……有人知道可能是什么错误吗?

在此之前我唯一做的就是使用以下命令安装 mysql-server:

sudo apt-get install mysql-server

我尝试安装和重新安装、更新和升级 ubuntu,我不确定这是否有帮助。

提前致谢!

更新:

我刚刚检查过,我的计算机中没有 /var/lib/mysql 目录。 但我无法通过重新安装 mysql 服务器/客户端来获得它。

我通过“清除”与 mysql 相关的每个文件并重新安装 mysql-server 来修复:

sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get install mysql-server

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM