Previously, RHEL6.3 and 6.4 were used. The system disk contains mysqlserver. After configuring the yum source, you can directly install the mysql server on the yuminstallmysql-server. recently, CentOS7.1 was used, I found that the system disk does not provide the mysql-server RPM Package. I collected the files from the Internet that used to use RHEL 6.3 and 6.4. The system disk contains the mysql server. After configuring the yum source, you can directly install mysql-server in yum install mysql-server to install the mysql server. recently, CentOS 7.1 was used and it was found that the system disk did not provide the mysql-server RPM Package. I searched for it online for a long time, finally, find the answer on the official mysql website.
Just add the following file mysql-community.repo file in the/etc/yum. repos. d/directory with the following content:
# Enable to use MySQL 5.6[mysql56-community]name=MySQL 5.6 Community Serverbaseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
The above version is 5.6.
The content of version 5.7 is 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 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
Run yum install mysql-community-server.
I am using version 5.6. during installation, the following error is reported:
GPG key retrieval failed: [Errno 14] curl #37-"Couldn't open file/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql"
Apparently, there is no RPM-GPG-KEY-mysql file locally, so I made some modifications to the above mysql-community.repo. the modified 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
Run the yum install mysql-community-server command again to install OK ~