1下载安装包:https://dev.mysql.com/downloads/mysql/8.0.html
2、解压安装包后可以看下如下文件列表
3、在当前目录打开终端
查看并卸载 mariadb
rpm -qa | grep mariadb
sudo rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
安装mysql ,也可以server和client 任选其一
sudo yum install mysql-community-{server,client,common,libs}-*
启动服务
sudo service mysqld start
查看服务状态
sudo service mysqld status
查看默认密码
sudo grep 'temporary password' /var/log/mysqld.log
连接后,修改密码SQL语句:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
...............................................................................................................................................................................................................................................................................