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

Ubuntu 20.04安装MySQL 8.0时出现配置报错如何解决?

Ubuntu 20.04 安装MySQL 8.0 报错解决方法

报错核心原因是mysql-common依赖包的文件缺失或残留损坏,仅卸载mysql-server包无法清理关联的依赖残留,按以下步骤操作即可解决:

  • 第一步:彻底卸载所有MySQL关联包
    执行命令:
    sudo apt remove --purge --autoremove mysql-server mysql-server-8.0 mysql-client mysql-client-8.0 mysql-common mysql-community* -y
    
  • 第二步:清理所有MySQL残留文件和dpkg配置脚本
    依次执行命令:
    sudo rm -rf /var/lib/mysql /etc/mysql /usr/share/mysql*
    sudo rm -f /var/lib/dpkg/info/mysql*
    
  • 第三步:修复dpkg状态和apt依赖
    依次执行命令:
    sudo dpkg --configure -a
    sudo apt update && sudo apt install -f -y
    
  • 第四步:重新安装MySQL 8.0
    执行命令:
    sudo apt install mysql-server -y
    

补充:如果执行完上述步骤仍报错,可先手动安装mysql-common包,确认/usr/share/mysql-common/configure-symlinks文件存在后再安装mysql-server即可。

内容的提问来源于stack exchange,提问作者Karnav Desai

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.21 02:24:05