1跳芳、獲取RPM源文件
2菊碟、下載需要的版本文件
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
3缠俺、yum加載配置文件
yum localinstall mysql57-community-release-el7-8.noarch.rpm
image.png
4苹粟、安裝
yum install mysql-community-server
image.png
5有滑、查看啟動服務(wù)
systemctl status mysqld
systemctl start mysqld
6、查找安裝時隨機產(chǎn)生的密碼
grep 'temporary password' /var/log/mysqld.log
7嵌削、登錄
mysql -u root -pEiR73KF,dGYl
8毛好、設(shè)置密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY 'EiR73KF,dGYl';
set password for 'root'@'localhost'=password('Niubi1234/');
9、授權(quán)遠(yuǎn)程訪問
grant all on *.* to 'root'@'%' identified by 'Niubi1234/';
10苛秕、重啟mysql
systemctl restart mysqld
11肌访、開啟防火墻端口
firewall-cmd --add-port=3306/tcp --permanent
systemctl restart firewalld.service
12、連接測試
image.png