先挂载镜像
bash
mount /dev/sr0 /mnt
cd /etc/yum.repos.d 配置yum源
vim yum.repo
配置仓库
bash
[BaseOS]
name=baseos
baseurl=/mnt/BaseOS
enabled=1
gpgcheck=0
[AppStream]
name=app
baseurl=/mnt/AppStream
enabled=1
gpgcheck=0
清空yum缓存
bash
yum clean all
创建yum缓存仓库
bash
yum makecache
查看列表
bash
yum repolist
下载地址
Mysql官网====>DOWNLOADS====>MySQL Community (GPL) Downloads ====>Download Archives下载档案====>MySQL Community Server MySql社区服务器====>MySQL Downloads
bash
wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.34-1.el9.x86_64.rpm-bundle.tar
tar xvf mysql-8.0.34-1.el9.x86_64.rpm-bundle.tar
*********
bash
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
启动服务
bash
systemctl start mysqld
第一次进入查看密码
bash
grep password /var/log/mysqld.log
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码'; (字母+数字+特殊符号)
用远程管理工具链接Mysql数据库
bash
systemctl stop firewalld.service
进入mysql
bash
use mysql;
执行修改命令
update user set host='%' where user='root'; #前面的user是表后面得user是用户名
刷新权限管理
flush privileges;