Amu*_*una 26 mysql package-management apt dependencies software-installation
我是这里的新手,所以请多多包涵。
我正在使用 ubuntu 14.04。
我尝试使用以下命令输入 mysql:
mysql -u root -p
Run Code Online (Sandbox Code Playgroud)
我收到以下消息:
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
Run Code Online (Sandbox Code Playgroud)
然后我输入:
sudo apt-get install mysql-client-core-5.6
Run Code Online (Sandbox Code Playgroud)
安装后,我尝试使用以下命令再次连接到 mysql:
mysql -u root -p
Run Code Online (Sandbox Code Playgroud)
然后我收到错误消息:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Run Code Online (Sandbox Code Playgroud)
网上查了一下,发现需要安装mysql服务器,所以写了下面的命令
sudo apt-get install mysql-server
Run Code Online (Sandbox Code Playgroud)
然后我收到了消息:
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.
Run Code Online (Sandbox Code Playgroud)
过去一个小时我一直在网上寻找解决方案,但其他人也有类似的错误,但由于升级 mysql 而出现错误,因此该解决方案对我无效。
kar*_*rel 44
打开终端并输入:
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
Run Code Online (Sandbox Code Playgroud)
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。
小智 9
以下命令解决了我的问题。
sudo aptitude install mysql-server
Run Code Online (Sandbox Code Playgroud)
如果您的计算机中未安装 aptitude,请先使用以下命令安装 aptitude。
sudo apt-get install aptitude
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
107645 次 |
最近记录: |