1.安装MySQL8.0资源库
yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
2.安装MySQL8.0
yum -y install mysql-community-server --nogpgcheck
.
yum -y install mysql-community-server --nogpgcheck
3.启动MySQL并配置开机自启
systemctl start mysqld
systemctl enable mysqld
4.查看密码
grep 'temporary password' /var/log/mysqld.log
5.登录数据库修改密码规则
需要先改一个密码:
查看版本:
6.允许root远程登录:
update mysql.user set host='%' where user="root";
flush privileges;