一,下载仓库包
wget -i -c https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
二,安装仓库
yum -y install mysql80-community-release-el7-3.noarch.rpm
sed -i 's/gpgcheck=1/gpgcheck=0/g' mysql-community.repo
三,安装MYSQL80
yum install -y mysql-community-{server,client,common,libs}-*
四,开启数据库并设置开启自启动
systemctl start mysqld
systemctl enable mysqld
五,找寻初始密码
grep 'password' /var/log/mysqld.log
六,登录数据库
mysql -uroot -p
七,修改密码
alter user 'root'@'localhost' iedntified by 'your password';