我正在遵循说明这里将 MySQL-Community-Server 安装到 Linux 6 AWS 实例上。
基本命令:
wget http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm
sudo yum localinstall mysql57-community-release-el6-8.noarch.rpm
mysql57
然后当我在我的“新” yum 存储库中搜索时,yum list all |grep mysql57
我得到以下内容:
mysql57-community-release.noarch el6-8 @/mysql57-community-release-el6-8.noarch
mysql-community-client.i686 5.7.13-1.el7 mysql57-community
mysql-community-client.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-common.i686 5.7.13-1.el7 mysql57-community
mysql-community-common.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-devel.i686 5.7.13-1.el7 mysql57-community
mysql-community-devel.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-embedded.i686 5.7.13-1.el7 mysql57-community
mysql-community-embedded.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-embedded-compat.i686 5.7.13-1.el7 mysql57-community
mysql-community-embedded-compat.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-embedded-devel.i686 5.7.13-1.el7 mysql57-community
mysql-community-embedded-devel.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-libs.i686 5.7.13-1.el7 mysql57-community
mysql-community-libs.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-libs-compat.i686 5.7.13-1.el7 mysql57-community
mysql-community-libs-compat.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-release.noarch el7-7 mysql57-community
mysql-community-server.x86_64 5.7.13-1.el7 mysql57-community
mysql-community-test.x86_64 5.7.13-1.el7 mysql57-community
mysql57-community-release.noarch el7-7 mysql57-community
因此看来 el6-8 链接正在安装对 el7 的引用???
当我尝试使用安装 mysql 时,sudo yum install mysql
出现以下错误
Downloading packages:
http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-client-5.7.13-1.el7.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-common-5.7.13-1.el7.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-libs-5.7.13-1.el7.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
当我尝试时sudo yum install mysql-community-server
出现错误:
Error: Package: mysql-community-server-5.7.13-1.el7.x86_64 (mysql57-community)
Requires: systemd
...这是在 el6 linux(不使用 systemd)上尝试安装 el7 时常见的错误
在这两种情况下,yum 都尝试从 el6-8 存储库下载 el7 包……
我该如何纠正这个问题?
PS 我尝试编辑/etc/yum.repos.d/mysql-community.repo
文件,但没有指定 Linux 版本
PPS 我也完全卸载了 yum repo 并尝试yum clean all
- 然后检查 yum list all |grep mysql57
没有结果 - 接着是全新安装 = 相同的结果
更新
我的文件内容/etc/yum.repos.d/mysql-community.repo
确认 repo 已设置为加载 el6 mysql:
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
答案1
我也遇到过这个问题,花了好几天才搞清楚。我也以为我使用的是 EL 7 操作系统,但我使用的是 6。我尝试安装 MySQL EL7 软件包,但收到需要 systemd 的错误。这是软件包不正确的第一个线索。
我删除了 EL7 软件包
sudo yum remove mysql57-community-release-el7-9.noarch
并安装了 EL6,但在运行时
sudo yum install mysql-community-server
它默认安装 EL7 软件包。我检查了我的 /etc/yum.repos.d/mysql-community.repo,但所有这些都指向 6,而不是 7。
经过几天的斗争,
sudo yum clean all
和
sudo yum update
修复了问题。之后,sudo yum install mysql-community-server 就可以完美运行了。