设为首页 加入收藏

TOP

Ubuntu重新安装MySQL错误解决
2018-05-21 15:49:35 】 浏览:386
Tags:Ubuntu 重新 安装 MySQL 错误 解决

Reading package lists...Done
Building dependency tree
Reading state information ... Done
mysql-server is already the newest version(5.7.21-0ubuntu0.16.04.1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server: depends: mysql-server-5.7 but it is not going to be installed
E: Unmet dependencies.Try 'apt-get -f install' with no packages(or specify a solution).


通过阅读错误信息可知,主要是因为依赖关系出现问题,主要思路是重建依赖关系,然后干净卸载,最后重装。


首先,更新系统


sudo apt-get update


然后,修复安装错误,会提示输入mysql用户名密码


sudo apt-get --fix-broken install


然后,检索mysql安装包,并删除检索出的依赖包,然后是删除/var/lib/mysql,最后重装mysql。


下面我把检索到的解决方法展示给大家:


We excute the following commands to solve the above problem:
    1.Get the list of MySQL packages installed on the system by executing the command sudo dpkg -l grep mysql
    2.Remove the packages shown above by executing the command
      sudo apt-get --purge autoremove <packages from the step 1>
    3. Delete /var/lib/mysql
    4.Try to install mysql again.It should solve your problem.


第二步中的packages如下图所示:



最后就是更新系统并重装mysql


sudo apt-get update


sudo apt-get install mysql-server mysql-client


总结:


整体思路还是重建依赖关系,干净卸载,更新安装。希望对遇到相同问题不知所措的小伙伴有所启发、帮助。谢谢。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇CentOS 6.4编译安装MySQL8.0 下一篇Ubuntu 配置MySQL远程连接

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目