Install mysql basic yum and mysql basic yum
2017-04-
I. experiment environment
Centos7_x64
Because mariadb is used to replace mysql in centos7 yum source by default, We have to configure the yum source first. Of course, mariadb and mysql are fully compatible, and all commands are common.
Ii. Install mysql1. configure yum source in yum
Here I chose the aliyun source, and the speed is fine. If mariadb is installed, you can directly use yum install mariadb-server to install the client and server.
Backup
1 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Download the new CentOS-Base.repo to/etc/yum. repos. d/
1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
To install mysql, We need to download a mysql repo as follows:
Go to this URL: http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/ find the mysql57-community-release-el7-10.noarch.rpm and download it.
1 [root@sharestore download]# wget http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm
1 [root@sharestore download]# rpm -ivh mysql57-community-release-el7-10.noarch.rpm
After installing this package, you will get the yum repo source for both mysql:/etc/yum. repos. d/mysql-community.repo,/etc/yum. repos. d/mysql-community-source.repo.
2. Install mysql
1 [root@sharestore download]# yum install mysql-community-server
The following four packages are installed:
1 (1/4): mysql-community-common-5.7.18-1.el7.x86_64.rpm | 271 kB 00:01 2 (2/4): mysql-community-libs-5.7.18-1.el7.x86_64.rpm | 2.1 MB 00:05 3 (3/4): mysql-community-client-5.7.18-1.el7.x86_64.rpm | 24 MB 08:51 4 (4/4): mysql-community-server-5.7.18-1.el7.x86_64.rpm | 162 MB 52:30