使用RPM在centos7上安装mysql

使用RPM在centos7上安装mysql

当我尝试通过 rpm 安装 mysql 时:

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-  5.6.19-1.linux_glibc2.5.x86_64.rpm-bundle.tar
tar xf MySQL-5.6.19-1.linux_glibc2.5.x86_64.rpm-bundle.tar
rpm -ivh MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-shared-5.6.19-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm

我收到错误:

file /usr/share/mysql/charsets/README from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64

file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/hungarian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/cp866.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/dec8.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/geostd8.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/greek.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/hebrew.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/hp8.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/keybcs2.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/koi8r.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/koi8u.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/latin1.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/latin2.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mariadb-libs-1:5.5.37-1.el7_0.x86_64

我在 CentOS 6 上遇到了类似的问题,只不过是 mysql 而不是 mariadb

我在网上找到的所有建议:

  1. 首先安装 shared-compat - 没有用
  2. yum remove mysql-libs。这将删除我不想要的库。即终止 cron。
  3. 使用 -force 选项进行 rpm 安装。这似乎与 #2 有相同的效果

我玩的是 yum 版本:

wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum localinstall mysql-community-release-el6-5.noarch.rpm
yum install mysql-community-server 

它想要替换 mariadb-libs.x86_64 1:5.5.37-1.el7_0。我不想使用 yum 方法,因为我想让 yum update 仅作为操作系统。所有其他软件都是从源代码编译的。

有没有办法让 rpm 工作而不覆盖现有软件?如果没有,从源代码编译可以吗?

答案1

哇,他们还没修复他们的包裹。已经好几年了。

我不建议使用 MySQL 内置的 RPM,主要是因为您遇到的这个原因,但如果您坚持,那么您需要同时切换出冲突的软件包。您可以使用 来yum shell执行此操作。

yum shell
> remove mariadb-libs
> localinstall MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64.rpm
> run

切换完包之后,其余的包就可以正常安装了。


或者你也可以按照yum install你的方法你不想做的事,这会更简单。

答案2

对于 RHEL 7 上的社区版 5.6,我必须:

yum install MySQL-shared-5.6.37-1.el7.x86_64.rpm MySQL-shared-compat-5.6.37-1.el7.x86_64.rpm

在安装 MySQL 服务器之前,需要同时安装这些。

答案3

您可以使用rpm -e(或yum remove)来删除/移除mariadb-server依赖项,例如mariadb-libs:),然后使用rpm -i(或yum localinstall)来安装新的RPMs。

答案4

对我有用的替代解决方案:

搜索损坏的软件包:(例如 mariadb-libs)

$ rpm -qa | grep mariadb-libs
mariadb-libs-5.5.52-1.el7.x86_64

删除此包:

rpm -ev --nodeps mariadb-libs-5.5.52-1.el7.x86_64

现在只需安装 mysql rpm 或 mysql-server。希望它能解决任何与损坏的软件包相关的依赖关系问题。

相关内容