1、检查系统是否有安装mysql或mariadb,如果有则删除
2、yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
3、yum install mysql-community-server
4、开启mysql服务service mysqld start
5、查看root密码cat /var/log/mysqld.log
6、需要修改默认root密码,不然什么都干不了。ALTER
user
'root'
@
'localhost'
IDENTIFIED
BY
'1qaz@WSX'; flush privileges;