gpt4 book ai didi

MySQL "start"在 ubuntu 20.04 中失败

转载 作者:行者123 更新时间:2023-12-04 18:25:30 25 4
gpt4 key购买 nike

我尝试运行命令: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

关于MySQL "start"在 ubuntu 20.04 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66436955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com