第一步:wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
第二步:yum localinstall mysql57-community-release-el7-8.noarch.rpm
第三步:yum repolist enabled | grep "mysql.-community."
第四步: yum install mysql-community-server
第五步:systemctl start mysqld
第六步:systemctl status mysqld
第七步:systemctl status mysqld.service
第八步:systemctl enable mysqld
第九步:systemctl daemon-reload
找到默認密碼:grep 'temporary password' /var/log/mysqld.log
生成默認密碼:fgqEQgPV3j*f
登錄并修改密碼:mysql -uroot -p
修改密碼:ALTER USER 'root'@'localhost' IDENTIFIED BY 'Ysx251924!';
授權(quán):GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'Ysx251924!' WITH GRANT OPTION;
開啟防火墻端口權(quán)限:1 查看端口 firewall-cmd --list-ports
2 開發(fā)端口 firewall-cmd --zone=public --add-port=3306/tcp --permanent
3 重啟 firewall-cmd --reload