Debian 8 - 安装最新版本的 MySQL

Debian 8 - 安装最新版本的 MySQL

下载 MYSQL APT 存储库后

http://cdn.mysql.com//Downloads/MySQL-5.7/libmysqld-dev_5.7.11-1debian8_amd64.deb

我运行了命令

dpkg -i libmysqld-dev_5.7.11-1debian8_amd64.deb

这是结果

Selecting previously unselected package mysql-community-server.
(Reading database ... 48773 files and directories currently installed.)
Preparing to unpack mysql-community-server_5.7.11-1debian8_amd64.deb ...
Unpacking mysql-community-server (5.7.11-1debian8) ...
dpkg: dependency problems prevent configuration of mysql-community-server:
 mysql-community-server depends on mysql-common (= 5.7.11-1debian8); however:
  Package mysql-common is not installed.
 mysql-community-server depends on mysql-client (= 5.7.11-1debian8); however:
  Package mysql-client is not installed.

dpkg: error processing package mysql-community-server (--install):
 dependency problems - leaving unconfigured
Processing triggers for systemd (215-17+deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 mysql-community-server

我做错了什么吗?我该如何修复它?

答案1

可以看到二进制包文件Depends里面的列表,然后DEBIAN/controllibmysqld-dev_5.7.11-1debian8_amd64.deb下载并安装您的系统没有的。

例子

> wget http://cdn.mysql.com//Downloads/MySQL-5.7/libmysqld-dev_5.7.11-1debian8_amd64.deb
> ar x libmysqld-dev_5.7.11-1debian8_amd64.deb
> tar xf control.tar.gz
> cat control | grep Depends
Depends: libmysqlclient-dev (= 5.7.11-1debian8)

如果您卸载的依赖项太多,我建议您安装的并按照该提供者的描述GPG key添加到。debian repositorysource/etc/apt/sources.listbinary package

使用 MySQL APT 存储库的快速指南

/etc/apt/sources.list这是您应该添加到 insde或任何.list文件中的行/etc/apt/sources.list.d/

deb http://repo.mysql.com/apt/debian jessie mysql-5.7

要安装,MySQL GPG Public key您可以运行:

> gpg --recv-keys 5072E1F5
> gpg --export 5072E1F5 > /etc/apt/trusted.gpg.d/5072E1F5.gpg

运行后apt-get update你应该能够安装你想要使用的包dpkg -i甚至运行apt-get install libmysqld-dev

答案2

我的服务器上也遇到了同样的问题。我的一些数据库盒子安装了 5.7.11 补丁后没有出现任何问题,而其他数据库盒子则产生了与您相同的错误。另外,如果这是升级,请尝试在采取以下措施之前注释掉 my.cnf 中的任何 ssl 设置。

我尝试了各种修复方法,但解决该问题的唯一方法是清除mysql除数据目录之外的所有内容。

首先备份您的数据。告诉它保留您的数据目录,并在 home 下或开箱即用的情况下保留您的配置目录的副本。完成后您需要更换它。

我的修复:

su
apt-get remove --purge mysql\*
apt-get autoremove
apt-get autoclean
deluser mysql
apt-get dist-upgrade
reboot

重新安装 mysql apt 存储库:

dpkg -i mysql-apt-config_0.6.0-1_all.deb
#update and install any needed system updates
apt-get update && apt-get upgrade
apt-get install mysql-server mysql-client
#enter new/same root password

你应该可以走了。

相关内容