#先下載
????wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
#安裝
????yum -y install mysql57-community-release-el7-10.noarch.rpm
????yum -y install mysql-community-server
#啟動
????systemctl start? mysqld.service
#開機自起
????systemctl enable mysqld
#查看狀態(tài)
????systemctl status mysqld.service
#找到密碼
????grep "password" /var/log/mysqld.log
#修改密碼
????mysql -uroot -p
????ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
#允許遠程訪問
????grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
????flush privileges;
????exit
#開啟防火墻
????firewall-cmd --zone=public --add-port=3306/tcp --permanent
????firewall-cmd --zone=public --add-port=8080/tcp --permanent
????firewall-cmd --reload