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;
相关推荐
小王努力学编程7 小时前
【MySQL篇】表的操作
数据库·mysql
汤汤upup7 小时前
面试八股文--数据库基础知识总结(2) MySQL
数据库·mysql·面试
TangKenny7 小时前
information_schema.processlist 表详解
mysql·processlist
m0_7482509310 小时前
mysql数据被误删的恢复方案
数据库·mysql
m0_7482384210 小时前
MySQL Workbench菜单汉化为中文
android·数据库·mysql
一小路一10 小时前
从0-1学习Mysql第五章: 索引与优化
数据库·后端·学习·mysql·面试
彤彤的小跟班11 小时前
MySQL进阶04-MVCC实现原理
数据库·mysql
huaqianzkh12 小时前
基于 ‌MySQL 数据库‌对三级视图(用户视图、DBA视图、内部视图)的详细解释
数据库·mysql·dba
ForTodayzzZ12 小时前
centos和ubuntu安装mysql教程
linux·mysql·ubuntu·centos
扣丁梦想家12 小时前
《Spring Boot + MySQL高性能应用实战:性能优化技巧与最佳实践》
spring boot·后端·mysql