-
下载包:
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
-
更新rpm缓存:
sudo rpm -ivh mysql80-community-release-el7-1.noarch.rpm
-
安装mysql-server:
sudo yum install mysql-community-server --nogpgcheck
强制安装,避免出现公钥尚未安装的情况(–nogpgcheck)
-
启动服务:
systemctl start mysqld.service
-
获取初始密码:
sudo cat /var/log/mysqld.log | grep password
Gu?rugGyW2mz -
登录:
mysql -u root -p
-
修改密码策略
sudo vi /etc/my.cnf
-
修改密码: