下載
在官網(wǎng)下載Yum repository
導(dǎo)入Yum repository
rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
安裝
yum install mysql-community-server
開啟MySQL
service mysqld start
查詢初始密碼
sudo grep 'temporary password' /var/log/mysqld.log
登錄修改密碼
# 登陸
mysql -u root -p
# 修改
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySQL1234!';
GRANT ALL PRIVILEGES ON \*.* to 'root'@'%' IDENTIFIED BY 'MySQL1234!' with grant option;
FLUSH PRIVILEGES;
重啟MySQL
service mysqld restart