【问题标题】:MySQL "start" fails in ubuntu 20.04MySQL“启动”在 ubuntu 20.04 中失败
【发布时间】:2021-05-31 20:27:58
【问题描述】:

我尝试运行命令:

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 database ubuntu ubuntu-20.04


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2020-08-12
      • 2021-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-26
      • 2020-09-06
      • 2022-12-04
      • 2018-07-14
      相关资源
      最近更新 更多