MySQL "start" 在 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 server/client.

没能成功

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

来修复
sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get install mysql-server