在CentOS 6.5上安装MySQL 5.6时出现依赖错误

4
我按照这篇文章 https://www.digitalocean.com/community/tutorials/how-to-install-mysql-5-6-from-official-yum-repositories 在CentOS上安装MySQL 5.6。
但是当我运行以下命令: sudo yum install mysql-community-server 我看到以下错误:
Error: Package: mysql-community-server-5.6.20-4.el7.x86_64 (mysql56-community)
       Requires: systemd
Error: Package: mysql-community-server-5.6.20-4.el7.x86_64 (mysql56-community)
       Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

事实上,无论我如何执行yum install mysql mysql-server,都会出现相同的错误。我在网上搜索了一下,但缺乏资源提到了'systemd'和'libstdc++.so.6'出了什么问题以及如何解决这个问题。


1
这不是一个编程问题,所以它在这里是离题的。请注意,您正在尝试安装为RHEL/Centos 7构建的软件包。 - nos
非常感谢您,nos!错误版本是我的问题! - M老立
2个回答

0

之前:

yum install openssh-server wget
yum -y update

列出您的存储库并删除mysql-community...
yum repolist

安装必要的仓库:
rpm -ihv http://mirror.yandex.ru/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ihv http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install yum-priorities

在这些文件中添加priority=10
vi /etc/yum.repos.d/epel.repo
vi /etc/yum.repos.d/nginx.repo
vi /etc/yum.repos.d/remi.repo

从新的仓库安装将会很好:

yum install mysql mysql-server

在完成这个之后:

chkconfig --levels 235 mysqld on
service mysqld start
/usr/bin/mysql_secure_installation

0
对于找不到的每个库,只需使用“yum provides”进行搜索,然后安装该软件包。
例如:
yum provides systemd
yum provides libstdc++.so.6

那么,您需要执行yum install systemd libstdc++的命令,根据您的搜索结果,您可能需要执行yum install libstdc++-<version>


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接