Mysql在Linux上安装

先挂载镜像

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;
相关推荐
Johny_Zhao1 小时前
OpenClaw中级到高级教程
linux·人工智能·信息安全·kubernetes·云计算·yum源·系统运维·openclaw
Hoffer_4 小时前
MySQL 强制索引:USE/FORCE INDEX 用法与避坑
后端·mysql
Hoffer_4 小时前
MySQL 索引核心操作:CREATE/DROP/SHOW
后端·mysql
Sheffield20 小时前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
Sheffield1 天前
Alpine是什么,为什么是Docker首选?
linux·docker·容器
0xDevNull2 天前
MySQL索引进阶用法
后端·mysql
0xDevNull2 天前
MySQL索引用法
mysql
Johny_Zhao2 天前
centos7安装部署openclaw
linux·人工智能·信息安全·云计算·yum源·系统运维·openclaw
haibindev2 天前
在 Windows+WSL2 上部署 OpenClaw AI员工的实践与踩坑
linux·wsl2·openclaw