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

Ubuntu 22.04 重装MySQL-server后遭遇dpkg配置错误与本地连接失败问题求助

Ubuntu 22.04 重装MySQL-server后遭遇dpkg配置错误与本地连接失败问题求助

各位好,我在Ubuntu 22.04上重装MySQL-server时碰到了棘手的问题,折腾了好一阵都没解决,想请教下大家的思路。

我已经尝试过谷歌搜索相关解决方案,也执行了purge命令彻底清理过MySQL相关包,但问题依然没有得到解决。

机器信息

  • Ubuntu 22.04

安装时的错误日志

执行sudo apt install mysql-server后,在安装流程末尾出现了以下错误:

update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode

Setting up libhtml-parser-perl:amd64 (3.76-1build2) ...

Setting up libhttp-message-perl (6.36-1) ...

Setting up mysql-server-8.0 (8.0.34-0ubuntu0.22.04.1) ...

/var/lib/dpkg/info/mysql-server-8.0.postinst: line 202: /usr/share/mysql-common/configure-symlinks: No such file or directory

dpkg: error processing package mysql-server-8.0 (--configure):

installed mysql-server-8.0 package post-installation script subprocess returned error exit status 127

Setting up libcgi-pm-perl (4.54-1) ...

Setting up libhtml-template-perl (2.97-1.1) ...

dpkg: dependency problems prevent configuration of mysql-server:

mysql-server depends on mysql-server-8.0; however:

Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):

dependency problems - leaving unconfigured

Setting up libcgi-fast-perl (1:2.15-1) ...

No apport report written because the error message indicates its a followup error from a previous failure.

Processing triggers for man-db (2.10.2-1) ...

Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

Errors were encountered while processing:

mysql-server-8.0

mysql-server

needrestart is being skipped since dpkg has failed

E: Sub-process /usr/bin/dpkg returned an error code (1)

本地连接错误

当我执行sudo mysql尝试连接时,会弹出以下错误:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

我检查过,/var/run/mysqld/mysqld.sock这个socket文件确实不存在。

我找过一些有类似问题的帖子,但都没找到能匹配我当前情况的解决方案,希望社区里的大佬能帮我看看怎么处理这个问题。

备注:内容来源于stack exchange,提问作者Panda Dev

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.21 15:29:39