You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Ubuntu 22.04.2后MySQL Community Server无法启动的问题排查求助

升级Ubuntu 22.04.2后MySQL Community Server无法启动的问题排查求助

大家好,我刚把DigitalOcean上的Ubuntu服务器升级到22.04.2版本,现在遇到了棘手的问题:

  • phpMyAdmin完全无法登录,弹出了以下4条错误信息:

Cannot log in to the MySQL server
mysqli::real_connect(): (HY000/2002): Connection refused
Connection for controluser as defined in your configuration failed
mysqli::real_connect(): (HY000/2002): Connection refused

  • 我的Flask网站也没法连接到MySQL数据库

我已经试过把/etc/mysql/my.cnf文件里的以下两行注释掉,但没有任何效果:

query_cache_limit =
query_cache_size =

运行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 Tue 2023-03-07 04:55:10 UTC; 52min ago
Process: 1830 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
CPU: 30ms

Mar 07 04:55:09 mail systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
Mar 07 04:55:09 mail systemd[1]: mysql.service: Failed with result 'exit-code'.
Mar 07 04:55:09 mail systemd[1]: Failed to start MySQL Community Server.
Mar 07 04:55:10 mail systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Mar 07 04:55:10 mail systemd[1]: Stopped MySQL Community Server.
Mar 07 04:55:10 mail systemd[1]: mysql.service: Start request repeated too quickly.
Mar 07 04:55:10 mail systemd[1]: mysql.service: Failed with result 'exit-code'.
Mar 07 04:55:10 mail systemd[1]: Failed to start MySQL Community Server.

运行journalctl -xeu mysql.service的输出如下:

An ExecStartPre= process belonging to unit mysql.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 07 04:55:09 mail 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'.
Mar 07 04:55:09 mail 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 1559 and the job result is failed.
Mar 07 04:55:10 mail systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ Automatic restarting of the unit mysql.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Mar 07 04:55:10 mail systemd[1]: Stopped MySQL Community Server.
░░ 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 1642 and the job result is done.
Mar 07 04:55:10 mail systemd[1]: mysql.service: Start request repeated too quickly.
Mar 07 04:55:10 mail 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'.
Mar 07 04:55:10 mail 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 1642 and the job result is failed.

现在我完全不知道该从哪里入手排查和修复这个问题,有没有大佬能给点思路或者解决方案?

备注:内容来源于stack exchange,提问作者Thilina Wimalapriya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 09:29:09