数据库
首页 > 数据库> > 无法安装mysql-server-5.5 /以下软件包有未满足的依赖项

无法安装mysql-server-5.5 /以下软件包有未满足的依赖项

作者:互联网

我是新手,所以请耐心等待.

我正在使用ubuntu 14.04.

我尝试使用以下命令输入mysql

mysql -u root -p

我收到以下消息:

The program mysql can be found on the following packages:
* mysql-client-core-5.5 
* mariadb-client-core-5.5 
* mysql-client-core-5.6 
* percona-xtrabd-cluster-client-5.5 

然后我输入:

sudo apt-get install mysql-client-core-5.6

安装完成后,我尝试使用以下命令再次连接到mysql:

mysql -u root -p

然后我收到了错误消息:

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

在线搜索后,我发现我需要安装mysql服务器,所以我在下面的命令中写道

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:

The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我一直在寻找过去一小时的解决方案,但其他人有类似的错误,但从升级mysql和因此有解决方案对我来说是无效的.

解决方法:

打开终端并输入:

sudo apt-get purge mysql-client-core-5.6
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt install mysql-client-core-5.5
sudo apt install mysql-server  

MySQL数据库核心客户端和MySQL服务器包都将是相同的版本5.5. MySQL Client 5.5和MySQL Server 5.5是Ubuntu 14.04中这些软件包的当前“最佳”版本,由软件包维护者决定.如果您更愿意安装MySQL Client 5.6和MySQL Server 5.6,您还可以在Ubuntu软件中心找到mysql-client-core-5.6和mysql-server-5.6软件包.重要的是客户端和服务器版本号在任何一种情况下都匹配.

在Ubuntu 16.04和18.04中,这两个包的名称是mysql-client-core-5.7和mysql-server-5.7.

标签:mysql,server,14-04
来源: https://codeday.me/bug/20190807/1611467.html