yum 安装MySQL教程

 

mysql官网教程

https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

目录是软件包安装源,需要配置,官网有相应教程

/etc/yum.repos.d/

创建MySQL 安装源 mysql-community.repo

内容

# Enable to use MySQL 5.7

[mysql57-community]

name=MySQL 5.7 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/

enabled=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

 

如果报gpgkey错误就把gpgcheck改成0,不校验就好了。

 

遇到的错误

http://blog.51cto.com/13155409/1969558

[root@xg79 ~]# yum -y installmysql-community-server

。。。。。。。。。。。。。

Error: Package:mysql-community-server-5.7.19-1.el6.x86_64 (mysql57-community)

           Requires: libsasl2.so.2()(64bit)

Error: Package:2:postfix-2.10.1-6.el7.x86_64 (@anaconda)

           Requires:libmysqlclient.so.18()(64bit)

           Removing:1:mariadb-libs-5.5.56-2.el7.x86_64 (@anaconda)

               libmysqlclient.so.18()(64bit)

           Obsoleted By:mysql-community-libs-5.7.19-1.el6.x86_64 (mysql57-community)

              ~libmysqlclient.so.20()(64bit)

Error: Package:2:postfix-2.10.1-6.el7.x86_64 (@anaconda)

           Requires:libmysqlclient.so.18(libmysqlclient_18)(64bit)

           Removing:1:mariadb-libs-5.5.56-2.el7.x86_64 (@anaconda)

              libmysqlclient.so.18(libmysqlclient_18)(64bit)

           Obsoleted By:mysql-community-libs-5.7.19-1.el6.x86_64 (mysql57-community)

               Not found

 You could try using --skip-broken to workaround the problem

 You could try running: rpm -Va --nofiles –nodigest

 

经过一下午的努力centos7安装mysql时遇到以上错误,解决安装包之后还是不能正确安装mysql,原来是自己的mysql源里面的6和我们使用的CentOS7不匹配导致mysql安装不成功,只需要把所以的6改成7即可

你可能感兴趣的:(MySQL)