1.在虚拟机/usr/local中创建myqsl目录
mkdir /mysql
2.在mysql目录中下载
cd mysql/
wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.34-1.el9.x86_64.rpm-bundle.tar
?
3.解压
tar xvf mysql-8.0.34-1.el9.x86_64.rpm-bundle.tar
4.安装
dnf localinstall mysql-community-server-8.0.34-1.el9.x86_64.rpm mysql-community-client-8.0.34-1.el9.x86_64.rpm mysql-community-common-8.0.34-1.el9.x86_64.rpm mysql-community-icu-data-files-8.0.34-1.el9.x86_64.rpm mysql-community-client-plugins-8.0.34-1.el9.x86_64.rpm mysql-community-libs-8.0.34-1.el9.x86_64.rpm
?
5.启动服务 ??
systemctl start mysqld
?
6.检查启动状况
systemctl status mysqld
?
7.查看日志以获取初始登录密码
grep password /var/log/mysqld.log
?
8.复制密码保存为首次登录做准备
mysql -uroot -p
.....初始密码.....
?
9.修改登录密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Openlab123!';
?