安装MariaDB时遇到问题

时间:2016-06-10 20:01:54

标签: centos mariadb

我有一个包含166791718行的数据集,我想使用SQL来管理数据。为了使用该语言,我需要在我的机器上安装它。

但是,我在Cent OS 7计算机上安装MariaDB时遇到问题。我跑

$ sudo yum install mariadb-server

这是我得到的输出:

Loaded plugins: fastestmirror, langpacks, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
 * epel: mirror.globo.com
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.47-1.el7_2 will be installed
--> Processing Dependency: mariadb(x86-64) = 1:5.5.47-1.el7_2 for package: 1:mariadb-server-5.5.47-1.el7_2.x86_64
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.47-1.el7_2 for package: 1:mariadb-server-5.5.47-1.el7_2.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.47-1.el7_2.x86_64
--> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.47-1.el7_2.x86_64
--> Processing Dependency: perl(DBI) for package: 1:mariadb-server-5.5.47-1.el7_2.x86_64
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.47-1.el7_2 will be installed
---> Package mariadb-libs.x86_64 1:5.5.47-1.el7_2 will be installed
---> Package perl-DBD-MySQL.x86_64 0:4.023-5.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
Removing mariadb-libs.x86_64 1:5.5.47-1.el7_2 - u due to obsoletes from installed mysql-community-libs-5.6.23-3.el7.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.47-1.el7_2 will be installed
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.47-1.el7_2 for package: 1:mariadb-5.5.47-1.el7_2.x86_64
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.47-1.el7_2 for package: 1:mariadb-server-5.5.47-1.el7_2.x86_64
--> Finished Dependency Resolution
Error: Package: 1:mariadb-5.5.47-1.el7_2.x86_64 (centos-7)
           Requires: mariadb-libs(x86-64) = 1:5.5.47-1.el7_2
           Available: 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 (centos-7)
               mariadb-libs(x86-64) = 1:5.5.44-2.el7.centos
           Available: 1:mariadb-libs-5.5.47-1.el7_2.i686 (centos-7)
              ~mariadb-libs(x86-32) = 1:5.5.47-1.el7_2
Error: Package: 1:mariadb-server-5.5.47-1.el7_2.x86_64 (centos-7)
           Requires: mariadb-libs(x86-64) = 1:5.5.47-1.el7_2
           Available: 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 (centos-7)
               mariadb-libs(x86-64) = 1:5.5.44-2.el7.centos
           Available: 1:mariadb-libs-5.5.47-1.el7_2.i686 (centos-7)
              ~mariadb-libs(x86-32) = 1:5.5.47-1.el7_2
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我已经尝试过

sudo yum install mariadb-server --skip-broken

rpm -Va --nofiles --nodigest
没有运气。有什么建议?

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,也接近这些话题:

  

_http://serverfault.com/questions/738242/reinstalling-mysql-on-centos-giving-conflicts   _http://unix.stackexchange.com/questions/82076/error-while-installing-perl-dbd-mysql

我的系统是虚拟机中的CentOS 7 64位。 以下是我解决问题的步骤:

1)设置MariaDB.repo

  

来源:_https://www.howtoforge.com/tutorial/install-mariadb-10-on-centos-6/

$ nano /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

(保存:ctrl + y,然后是y,然后是Carriage-Return)

2)为mysql使用正确的GPG密钥

update content of /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql with _http://repo.mysql.com/RPM-GPG-KEY-mysql
$ vi /etc/yum.repos.d/CentOS-MySql.repo 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

3)激活mariadb.service

  

来源:_https://www.vultr.com/docs/install-mariadb-on-centos-7

$ systemctl start mariadb.service
$ systemctl enable mariadb.service
$ systemctl is-active mariadb.service

4)从yum中排除mariadb

  

来源:_https://discuss.erpnext.com/t/mariadb-error-while-yum-update-with-centos-7/4439

$ vi /etc/yum.conf file
exclude=mariadb*

5)由于mariadb和mysql之间的冲突而停用mariadb.service

  

来源:_https://www.centos.org/forums/viewtopic.php?t = 52860

$ systemctl stop mariadb.service
$ systemctl disable mariadb.service

6)升级你的系统

$ yum upgrade

我希望你能在这些步骤中找到一些提示。抱歉" _http",但由于这是我在这里的第一篇帖子,我无法添加超过2个链接。

答案 1 :(得分:0)

我建议使用CentOS插件 protectbase ,该插件在处理多个第三方存储库或仅处理EPEL/RPMForge

时会有所帮助

您可以使用“ yum --disablerepo=[reponame]”,但这是一次性使用的选项,如果您想持续保护系统,那么我强烈建议您使用“ protectbase”

"yum install yum-plugins-protectbase"

然后在要保护的存储库上添加“ protect=1”。又名CentOS-Base 并在epel.repo中添加“ protect = 0”,这应该可以解决在处理第三方存储库时最常见的冲突。

我在Dealing with multiple repositories on CentOS 4/5/6/7

的博客上创建了更深入的指南