目录
?1.1 打开MySQL官网https://dev.mysql.com/downloads/repo/yum/
?1.2 下载RHEL9版本yum源安装包,点击“Download”选项
?1.3 页面跳转后点击“No thanks,just start my download”选项后启动下载
?2.1下载的yum源安装包默认在Downloads目录下,终端输入命令
cd Downloads/
?2.2 安装MySQL8.0的yum源(rpm包版本号替换为实际下载版本,此处版本为el9-5)
rpm -ivh mysql80-community-release-el9-5.noarch.rpm
yum install -y mysql-community-server
systemctl start mysqld.service
grep "password" /var/log/mysqld.log
输出日志红框处即为默认密码
mysql -u root -p
弹出Enter password提示,输入密码:dah(AhTz87u=,即成功登陆MySQL
ALTER USER 'root'@'localhost' IDENTIFIED BY '123test';
此时密码即修改为“123test”,MySQL8.0可以正常使用啦~