【问题标题】:Issue installing mysql-server-5.6 on Ubuntu 16.04在 Ubuntu 16.04 上安装 mysql-server-5.6 时出现问题
【发布时间】:2020-07-07 05:39:43
【问题描述】:

我在尝试安装 mysql-server-5.6: sudo apt-get install mysql-server-5.6 时收到此错误消息:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  mysql-server-5.6
0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded.
Need to get 0 B/6,004 kB of archives.
After this operation, 52.7 MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 75769 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb ...
Aborting downgrade from (at least) 5.7 to 5.6.
If are sure you want to downgrade to 5.6, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

mysql-client-5.6安装正常。

我先卸载了mysql-server-5.7

sudo apt-get remove dbconfig-mysql
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean

我使用这 2 种方法添加了 repos:

sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
sudo apt-get update

sudo add-apt-repository -y ppa:ondrej/mysql-5.6
sudo apt-get update

注意我也安装了PHP 5.6 没有任何问题。

由于我所有的项目都依赖于MCRYPT,我必须安装此版本才能正常运行。

我用了mysql-server-5.7,但是不兼容……数据没有插入mysql服务器。

需要您的帮助,在此先感谢您。

【问题讨论】:

  • 它在错误消息中显示:If are sure you want to downgrade to 5.6, remove the file /var/lib/mysql/debian-*.flag and try installing again. -- 您是否尝试删除该文件?

标签: php mysql ubuntu mysqli lamp


【解决方案1】:

我认为问题出在 mysql 客户端,因为您已经拥有它并且它正在尝试安装它,这导致了错误。

运行此命令以清理未使用的库:

sudo apt-get autoremove

然后尝试重新安装它

【讨论】:

  • 嗨,谢谢你的回答,但我已经回答了,你可以查看我的帖子:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-13
  • 2020-07-26
  • 2011-06-10
  • 1970-01-01
  • 2016-11-27
相关资源
最近更新 更多