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;
相关推荐
奇点 ♡6 分钟前
MySQL基础题
数据库·sql·mysql
cherry523016 分钟前
Java大厂面试真题:Spring Boot + 微服务 + 缓存架构三轮技术拷问实录
jvm·spring boot·mysql·微服务·java面试·分布式架构·redis缓存
唐古乌梁海23 分钟前
【mysql】MySQL 数据库迁移
数据库·mysql·adb
JanelSirry40 分钟前
真实场景:防止缓存穿透 —— 使用 Redisson 布隆过滤器
数据库·mysql·缓存·redisson·布隆过滤器
SoulKuyan44 分钟前
android su执行命令
linux·运维·服务器
Zhao_yani1 小时前
Centos 7安装Apache Drill
linux·centos·drill
mmm.c1 小时前
mysql启动提示1067:进程意外终止
数据库·mysql
一叶飘零_sweeeet1 小时前
Linux 安装 Elasticsearch:避坑指南 + 性能调优实战
linux·运维·elasticsearch
梁正雄1 小时前
linux-shell-基础与变量和运算符-1
linux·运维
HIT_Weston1 小时前
23、【Ubuntu】【远程开发】内网穿透:SSH 反向隧道
linux·ubuntu·ssh