Centos7离线安装MySQL8

1、下载MySQL

https://downloads.mysql.com/archives/community/

2、下载完毕后,上传到Centos,解压

bash 复制代码
tar -xf mysql-8.0.33-1.el7.x86_64.rpm-bundle.tar  

3、逐条执行安装命令

bash 复制代码
rpm -ivh mysql-community-common-8.0.33-1.el7.x86_64.rpm 
rpm -ivh mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm 
rpm -ivh mysql-community-libs-8.0.33-1.el7.x86_64.rpm 
rpm -ivh mysql-community-client-8.0.33-1.el7.x86_64.rpm 
rpm -ivh mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm 
rpm -ivh mysql-community-icu-data-files-8.0.33-1.el7.x86_64.rpm 
rpm -ivh mysql-community-server-8.0.33-1.el7.x86_64.rpm 
mysqld --initialize --user=mysql
systemctl status mysqld
systemctl start mysqld
systemctl status mysqld

4、查看临时密码

bash 复制代码
cat /var/log/mysqld.log

5、修改mysql的root密码

bash 复制代码
alter user 'root'@'localhost' identified by 'xxxxxx'

执行完后,重新登录MySQL

bash 复制代码
quit

6、允许远程登录

bash 复制代码
mysql -uroot -p
bash 复制代码
use mysql;

select host from user where user='root';

update user set host = '%' where user ='root';

更新配置

bash 复制代码
flush privileges;
相关推荐
djjjx.3 小时前
Mysql数据库基础篇(八):详细讲解复合查询、多表查询、自连接、多行、多列子查询与合并查询
数据库·mysql
MSTcheng.8 小时前
【MySQL】MySQL数据库——表的操作
数据库·mysql·adb
FungLeo8 小时前
FengCMS · PHP+MySQL 升级实录 · 内容写入一致性:锁等待超时与跨模型子树删除竞态
开发语言·mysql·php·工程实践·fengcms
ZhengEnCi9 小时前
覆盖索引是什么:用借书和外卖看懂回表这件事
sql·mysql·postgresql
鹤落晴春9 小时前
MySQL日志梳理
运维·数据库·mysql
FungLeo10 小时前
FengCMS · PHP+MySQL 升级实录 · MySQL DDL不能回滚:模型字段结构操作的失败续做
android·mysql·php·工程实践·fengcms
隔窗听雨眠11 小时前
MySQL锁等待的定位方法与治理体系
mysql·锁机制·数据库运维
千寻技术帮15 小时前
基于Spring Boot+Vue的农产品销售管理系统(源码+文档+数据库,附部署教程)
java·数据库·spring boot·后端·mysql·vue
Star(up up up)16 小时前
MySQL 事务隔离级别是如何实现的?从 MVCC 到锁机制原理详解
笔记·vscode·sql·学习·程序人生·mysql·学习方法
Decay__1 天前
PostgreSQL 数据库全栈运维实战系列 — 合集索引(24 篇)
运维·数据库·sql·mysql·架构