> wget http://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 enable mysqld
> systemctl daemon-reload
複製代碼
> grep 'temporary password' /var/log/mysqld.log
複製代碼
> mysql -uroot -p9L2dgbYNtZ.d
> alter user 'root'@'localhost' identified by '#{new password}'
複製代碼
必須包含:大小寫字母、數字和特殊符號,而且長度不能少於8位mysql
> grant all privileges on *.* to 'root'@'%' identified by '#{new password}' with grant option;
複製代碼
-- 查看防火牆狀況
> systemctl status firewalld.service
-- 關閉防火牆
> systemctl stop firewalld.service
-- 設置防火牆開機不啓動
> systemctl disable firewalld.service
複製代碼