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;
相关推荐
冰冰菜的扣jio3 小时前
MySQL三大重要日志详解
数据库·mysql
哈里谢顿3 小时前
django操作mysql常见错误大全
mysql·django
zwjapple4 小时前
MySQL SQL 面试核心考点与注意事项总结
数据库·sql·mysql
Knight_AL4 小时前
MySQL 分区表应用案例:优化数据管理与性能
数据库·mysql
luoluoal5 小时前
基于python的爬虫的贵州菜价可视化系统(源码+文档)
python·mysql·django·毕业设计·源码
九皇叔叔5 小时前
MySQL 数据库 MVCC 与锁如何联手解决脏读、不可重复读、幻读
数据库·mysql
哈里谢顿5 小时前
mysql索引影响查询速度的示例demo
mysql
苏琢玉6 小时前
一次受限环境下的 MySQL 数据导出与“可交付化”实践
mysql·php
不会kao代码的小王6 小时前
BoostKit 数据库优化原理分析从 MySQL 到 MariaDB 的性能突破
数据库·mysql·mariadb
jgyzl6 小时前
DDL、DML、DQL、DCL基本介绍及mysql47题
数据库·mysql