无法在Ubuntu 16.04上安装mysql [英] unable to install mysql on ubuntu 16.04

查看:853
本文介绍了无法在Ubuntu 16.04上安装mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了以下命令

wget http://repo.mysql.com/mysql-apt-config_0.8.9-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.9-1_all.deb
sudo apt-get update

一切顺利,但当我命中

sudo apt-get install mysql-server

它给了我以下错误

某些软件包无法安装.这可能意味着您有 请求一个不可能的情况,或者您使用的是不稳定的情况 分发一些尚未创建的必需软件包,或者 已从传入"中移出.以下信息可能有助于 解决情况:

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

以下软件包具有未满足的依赖项:mysql-server: 取决于:mysql-community-server(= 5.7.20-1ubuntu16.04)但不是 即将安装E:无法纠正问题,您已举行 破损的包裹.

The following packages have unmet dependencies: mysql-server : Depends: mysql-community-server (= 5.7.20-1ubuntu16.04) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

要修复我确实跑过的破损包裹

To fix broken packages i did ran

sudo apt-get install -f
sudo apt autoremove 
sudo apt-get update

但都是徒劳的.预先感谢你们:)

but all in vain. Thanks to you guys in advance :)

推荐答案

首先,我使用以下命令删除了MySQL:

To begin with, I deleted MySQL with:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

然后我从官方页面下载了.deb,并使用了以下命令:

Then I downloaded the .deb from oficial page and used the following commands:

curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
sudo dpkg -i mysql-apt-config*
sudo apt update
sudo apt install mysql-server -y

这时,由于Ubuntu eoan不兼容"(我使用的是Ubuntu 19.10),我遇到了麻烦,显示了一条消息:"MySQL不支持检测到的系统(Debian jessie).如果您认为该平台是如果与支持的系统之一兼容,则可以选择相应的存储库之一".但是我在 MySQL错误页面中进行了研究,并运行了:

At this point I had trouble because of Ubuntu eoan "incompability" (I'm using Ubuntu 19.10), displaying a message like: "The detected system (Debian jessie) is not supported by MySQL. If you believe the platform is compatible with one of the supported systems, one of the corresponding repositories may be selected". But I researched in MySQL bugs page and ran:

dpkg -i mysql-apt-config_0.8.13-1_all.deb 
sudo apt update
sudo apt install mysql-server -y

完成后,可以使用以下方法检查安装:

When it finishes, you may check the installation with:

sudo systemctl status mysql.service

您应该会看到类似...

And you should see something like...

这对我来说很有效,在StackExchange中尝试解决方案后,没有一个起作用.我希望这有帮助!如果我做错了,请寻求反馈,谢谢.

This worked for me, after trying solutions in StackExchange, none of which worked. I hope this helps! Looking for feedback if I did something wrong, thanks.

这篇关于无法在Ubuntu 16.04上安装mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆