在 CentOS 7 上安装 MySql 失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30696902/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:05:09  来源:igfitidea点击:

Fails installing MySql on CentOS 7

mysqlcentos7

提问by user697911

Why does it have something to do with mariadb? I had a fresh installation of CentOS 7 and wanted to install MySql community version. It seems to say I have to first install Mariadb server?

为什么和mariadb有关系?我全新安装了 CentOS 7,想安装 MySql 社区版。好像说要先安装Mariadb服务器?

# yum install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: linux.mirrors.es.net
 * extras: linux.mirrors.es.net
 * updates: linux.mirrors.es.net
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.35-3.el7 will be obsoleted
--> Processing Dependency: mariadb-server for package: akonadi-mysql-1.9.2-4.el7.x86_64
---> Package mysql-community-server.x86_64 0:5.6.25-2.el7 will be obsoleting
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.25-2.el7 for package: mysql-community-server-5.6.25-2.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) = 5.6.25-2.el7 for package: mysql-community-server-5.6.25-2.el7.x86_64
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.35-3.el7 will be obsoleted
---> Package mariadb-server.x86_64 1:5.5.35-3.el7 will be updated
---> Package mariadb-server.x86_64 1:5.5.41-2.el7_0 will be an update
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.41-2.el7_0 for package: 1:mariadb-server-5.5.41-2.el7_0.x86_64
--> Processing Dependency: mariadb(x86-64) = 1:5.5.41-2.el7_0 for package: 1:mariadb-server-5.5.41-2.el7_0.x86_64
---> Package mysql-community-client.x86_64 0:5.6.25-2.el7 will be obsoleting
---> Package mysql-community-common.x86_64 0:5.6.25-2.el7 will be installed
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.35-3.el7 will be updated
---> Package mariadb.x86_64 1:5.5.41-2.el7_0 will be an update
---> Package mariadb-libs.x86_64 1:5.5.35-3.el7 will be obsoleted
---> Package mariadb-libs.x86_64 1:5.5.35-3.el7 will be updated
---> Package mariadb-libs.x86_64 1:5.5.41-2.el7_0 will be an update
---> Package mysql-community-libs.x86_64 0:5.6.25-2.el7 will be obsoleting
Removing mariadb-server.x86_64 1:5.5.41-2.el7_0 - u due to obsoletes from mysql-community-server.x86_64 0:5.6.25-2.el7 - u
Removing mariadb.x86_64 1:5.5.41-2.el7_0 - u due to obsoletes from mysql-community-client.x86_64 0:5.6.25-2.el7 - u
Removing mariadb-libs.x86_64 1:5.5.41-2.el7_0 - u due to obsoletes from mysql-community-libs.x86_64 0:5.6.25-2.el7 - u
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.41-2.el7_0 will be an update
---> Package mariadb-libs.x86_64 1:5.5.41-2.el7_0 will be an update
---> Package mariadb-server.x86_64 1:5.5.41-2.el7_0 will be an update
--> Processing Dependency: mariadb-server for package: akonadi-mysql-1.9.2-4.el7.x86_64
--> Finished Dependency Resolution
Error: Package: akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda)
           Requires: mariadb-server
           Removing: 1:mariadb-server-5.5.35-3.el7.x86_64 (@anaconda)
               mariadb-server = 1:5.5.35-3.el7
           Obsoleted By: mysql-community-server-5.6.25-2.el7.x86_64 (mysql56-community)
               Not found
           Updated By: 1:mariadb-server-5.5.41-2.el7_0.x86_64 (base)
               mariadb-server = 1:5.5.41-2.el7_0

回答by Manjunath

In CentOS 7 - Maria DB is already installed. due to this you are facing the issue.{MariaDB is a compatible implementation of MySQL}. If you want to install Mysql - first you should remove the current existing Mari DB.

在 CentOS 7 中 - Maria DB 已安装。因此,您面临这个问题。{MariaDB 是 MySQL 的兼容实现}。如果你想安装 Mysql - 首先你应该删除当前现有的 Mari DB。

Step 1 : Remove Maria DB completely i.e. yum -y remove mariadb-libs

第 1 步:完全删除 Maria DB,即 yum -y remove mariadb-libs

Step 2 : Install MySQL

第 2 步:安装 MySQL

     i. wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
     ii. yum localinstall mysql57-community-release-el7-7.noarch.rpm
     iii. yum repolist enabled | grep "mysql.*-community.*"
     iv. yum install mysql-community-server
     v. yum-config-manager --disable mysql57-community
     vi. yum-config-manager --enable mysql56-community
     viii. service mysqld start
     ix. service mysqld status
     x. mysql --version
     xi. mysql -u root -p

Regards,

问候,

Manjunath Naik

曼朱纳斯奈克

回答by Tokyo user

You should remove Maiadb first.

您应该先删除 Maiadb。

# yum -y remove mariadb-libs