1, yum install wget
yum install wget
2, download the MySQL yum repo
wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
3、安装 mysql57-community-release-el7-11.noarch.rpm
yum install -y mysql57-community-release-el7-11.noarch.rpm
4, to see if the installation was successful
yum list |grep mysql
5, modify yum warehouse source
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
6, the official installation
yum -y install mysql-community-server
7, see the installation results
yum list installed|grep mysql
8, see the MySQL service status
systemctl status mysqld
9, start the MySQL service
systemctl start mysqld
10, modify the MySQL root password
grep "password" /var/log/mysqld.log mysql -uroot -p set global validate_password_policy=0; set global validate_password_length=0; ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
11, open Remote Access
use mysql select host,user from user; update user set host='%' where user='root';
12, open the firewall port 3306