The default yum source for CentOS 7 is mariadb, not our usual MySQL.
This article will show you how to install MySQL through yum.
- First download the Yum source rpm package
Specific address in:
http://repo.mysql.com/
You can choose the version you want.
What I have downloaded is:
wget http://repo.mysql.com/mysql57-community-release-el7.rpm
- Installing RPM files
Install the Yum source from MySQL by command:
RPM-IVH mysql57-community-release-el7.rpm
You can see the associated repo file in/ETC/YUM.REPOS.D:
[[email protected] yum.repos.d]# ls
Centos-base.repo Centos-debuginfo.repo Centos-media.repo Centos-vault.repo Mysql-community-source.repo
Centos-cr.repo Centos-fasttrack.repo Centos-sources.repo Mysql-community.repo Openlogic.repo
[Email protected] yum.repos.d]#
- Yum install MySQL
Install with the Yum command:
Yum Install-y mysql-server
- Start MySQL
Start:
Systemctl Start mysqld
View:
Systemctl Status Mysqld
Set boot up:
Systemctl Enable Mysqld
View by Netstat:
[Email protected] yum.repos.d]# NETSTAT-TUNLP
Active Internet connections (only servers)
Proto recv-q send-q Local address Foreign address State Pid/program Name
TCP 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
TCP 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 808/dnsmasq
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 807/sshd
TCP 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 909/master
TCP6 0 0::: 111:::* LISTEN 1/systemd
TCP6 0 0::: $:::* LISTEN 1526/httpd
TCP6 0 0::: +:::* LISTEN 808/DNSMASQ
TCP6 0 0::: $:::* LISTEN 807/sshd
TCP6 0 0:: 1:25:::* LISTEN 909/master
TCP6 0 0::: 3306:::* LISTEN 24276/mysqld
UDP 0 0 127.0.0.1:323 0.0.0.0:* 498/chronyd
UDP 0 0 0.0.0.0:617 0.0.0.0:* 12738/rpcbind
UDP 0 0 0.0.0.0:40620 0.0.0.0:* 757/dhclient
UDP 0 0 0.0.0.0:53 0.0.0.0:* 808/dnsmasq
UDP 0 0 0.0.0.0:68 0.0.0.0:* 757/dhclient
UDP 0 0 0.0.0.0:111 0.0.0.0:* 12738/rpcbind
UDP6 0 0:: 1:323:::* 498/chronyd
UDP6 0 0::: 617:::* 12738/rpcbind
UDP6 0 0::: 40419:::* 757/dhclient
UDP6 0 0::: +:::* 808/dnsmasq
UDP6 0 0::: 111:::* 12738/rpcbind
You can see Port 3306.
CentOS7 installing MySQL Server