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;
相关推荐
momo小菜pa9 小时前
【MySQL 06】表的增删查改
数据库·mysql
程序员大金12 小时前
基于SpringBoot+Vue+MySQL的装修公司管理系统
vue.js·spring boot·mysql
gorgor在码农12 小时前
Mysql 索引底层数据结构和算法
数据结构·数据库·mysql
-seventy-12 小时前
SQL语句 (MySQL)
sql·mysql
一般路过糸.13 小时前
MySQL数据库——索引
数据库·mysql
无敌少年小旋风14 小时前
MySQL 内部优化特性:索引下推
数据库·mysql
翔云12345614 小时前
MVCC(多版本并发控制)
数据库·mysql
静听山水15 小时前
mysql语句执行过程
数据库·mysql
Q_w774216 小时前
一个真实可用的登录界面!
javascript·mysql·php·html5·网站登录
容器( ु⁎ᴗ_ᴗ⁎)ु.。oO17 小时前
MySQL事务
数据库·mysql