centos7 离线安装MySQL8.0.26 记录

2021/8/28 2:06:00

本文主要是介绍centos7 离线安装MySQL8.0.26 记录,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

删除原有mariadb

[root@test mysql]# rpm -qa | grep mariadb
mariadb-devel-5.5.52-1.axs7.x86_64
mariadb-libs-5.5.52-1.axs7.x86_64
[root@test mysql]# rpm -e --nodeps mariadb-libs-5.5.52-1.axs7.x86_64
[root@test mysql]# rpm -qa | grep mariadb                           
mariadb-devel-5.5.52-1.axs7.x86_64
[root@test mysql]# rpm -e --nodeps mariadb-devel-5.5.52-1.axs7.x86_6

安装rpm包

rpm -ivh mysql-community-client-plugins-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-embedded-compat-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-test-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-8.0.26-1.el7.x86_64.rpm

标题启动MySQL 查看初始密码

 systemctl start mysqld
 # 查看mysql 状态
 systemctl status mysqld

cat /var/log/mysqld.log | grep password
2021-08-02T02:53:22.066347Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Rk)fZFq%+7ru

修改默认密码

use mysql;
alter  USER   'root'@'localhost' identified with  mysql_native_password by 'DqyG89GwUjm1vR0oUqhH@';

开启远程登录

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

创建子用户

use mysql;
CREATE USER  'pfpj'@'%' IDENTIFIED BY 'DqyG89GwUjm1vR0oUqhH@';
GRANT ALL ON *.* TO 'pfpj'@'%';
flush  privileges ;
-- 验证

开机启动

systemctl enable mysqld
#取消开机启动
 systemctl disable mysqld  
 netstat -ntlp | grep  mysql

数据初始化

use nmggzhhz;
source  /app/mysql/nmggzhhz.sql;
show tables ;

select * from t_bank_enterprise_balance ;


这篇关于centos7 离线安装MySQL8.0.26 记录的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程