How to install MySQL Server in CentOS 7

Source: Internet
Author: User

How to install MySQL Server in CentOS 7

Previously, RHEL 6.3 and 6.4 were used. The system disk contains the mysql server. After configuring the yum source, you can directly install mysql-server on the yum install mysql server. Recently, CentOS 7.1 was used, I found that the system disk did not provide the mysql-server RPM package. I searched for the package online for half a day and finally found the answer on the mysql official 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 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 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 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

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 Server
Baseurl = http://repo.mysql.com/yum/mysql-5.6-community/el/5/?basearch/
Enabled = 1
Gpgcheck = 0

Run the yum install mysql-community-server command again to install OK ~

The following is the MySQL-related content carefully selected by the editor to see if it is helpful:

Install and compile MySQL5.5.28 in Linux

Install MySQL 5.6.23 in Linux

Install MySQL 5.6 with the source code in CentOS 7

How to install and configure MySQL5.7.3.0

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

MySQL-5.5.38 universal binary Installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.