Step 1: Install the Internet to download files from the command wget
[root@master ~]# yum -y install wget
Step two: repo source of mysql download
[root@master ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
Step 3: Install mysql-community-release-el7-5.noarch.rpm package
[root@master ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
Step 4: Check under
[root@master ~]# ls -1 /etc/yum.repos.d/mysql-community* /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo
Two will get the mysql yum repo source: /etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo.
Step 5: Install mysql
[root@master ~]# yum install mysql-server
Start mysql service #
Service Start mysql
# using the initial password to log in and change the password mysql service
mysql -p-uroot-
the ALTER the User 'root' @ 'localhost' IDENTIFIED by 'root';
flush privileges;