Previously used Rhel 6.3 and 6.4, the system disk with MySQL server, after the configuration of Yum source, direct yum install mysql-server can be installed MySQL server side, the recent use of CentOS 7.1, found that the system disk does not provide mysql-server RPM package, on the internet for half a day, and finally found the answer on the official MySQL website.
Simply add the following file Mysql-community.repo file under the/etc/yum.repos.d/directory, as follows:
The above corresponds to the 5.6 version.
The contents of version 5.7 are as follows:
# Note:mysql 5.7 is currently in development. For use at your own risk.#. 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 releasebaseurl=http://repo.mysql.com/yum/ mysql-5.7-community/el/6/$basearch/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql
Finally execute the Yum install Mysql-community-server.
I am using the 5.6 version of the content, during the installation process, reported the following error:
GPG Key retrieval failed: [Errno] 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 the above Mysql-community.repo made a few changes, the revised content is as follows:
[Mysql56-community]name=mysql 5.6 Community serverbaseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$ Basearch/enabled=1gpgcheck=0
Re-execute the Yum install mysql-community-server command, install ok~
How to install MySQL server in CentOS 7