Home>

Previously, rhel 6.3 and 6.4 have been used. The mysql server is included in the system disk. After configuring the yum source, you can directly install mysql server by yum install mysql-server.Recently using centos 7.1, I found that the system disk does not provide the rpm package of mysql-server, and searched the Internet for a long time.Finally found the answer on the mysql official website.

Just add the following file mysql-community.repo file in /etc/yum.repos.d/directory, the content is as follows:

#enable to use mysql 5.6
[mysql56-community]
name=mysql 5.6 community server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql

The above corresponds to version 5.6.

The contents of version 5.7 are as follows:

#note:mysql 5.7 is currently in development. for use at your own risk.
#please read with sub pages:https://dev.mysql.com/doc/relnotes/mysql/5.7/en/
[mysql57-community-dmr]
name=mysql 5.7 community server development milestone release
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql

Finally, execute yum install mysql-community-server.

I am using version 5.6.During the installation process,Reported the following error:

gpg key retrieval failed:[errno 14] curl #37-"couldn" t open file/etc/pki/rpm-gpg/rpm-gpg-key-mysql "

Obviously, there is no rpm-gpg-key-mysql file locally, so I modified the mysql-community.repo above.The modified content is as follows:

[mysql56-community]
name=mysql 5.6 community server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/
enabled=1
gpgcheck=0

Re-execute the yum install mysql-community-server command and install ok ~

  • Previous JavaScript learning summary of the abandoned eval function and with statement examples
  • Next Centos 7 install mysql55 and the command used to install mariadb