centos7离线部署mysql5.7参考指南

1.新建目录mysql  /usr/local/目录下
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659349512_22.png)
2.检验服务器是否自带数据库:rpm -qa | grep mariadb*,有则删除:rpm -ev --nodeps mariadb-libs-5.5.68-1.el7.x86_64
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659349607_36.png)
3.上传mysql安装包至/usr/local/mysql目录下
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659349790_13.png)
4.切换至/usr/local/mysql目录并解压 tar -xf mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659349846_85.png)
5.当前目录顺序安装如下rpm包
rpm -ivh mysql-community-common-5.7.37-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.37-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.37-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.37-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.37-1.el7.x86_64.rpm
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659350056_53.png)
6.启动mysql服务:systemctl start mysqld  并查看状态:systemctl status mysqld
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659350101_32.png)
7.获取临时密码:grep 'temporary password' /var/log/mysqld.log
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659350205_34.png)
8.密码登录mysql -u root -p
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659350252_78.png)
9.修改密码复杂度,设置时区,修改密码
set global validate_password_policy=LOW;
set global validate_password_length=5;
set global time_zone = '+8:00';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'yunwei@123!';
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659350372_37.png)
10.重新登录后修改远程或其他地址访问
use mysql;
update user set Host='%' where User='root';
flush privileges;
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659350460_72.png)
11.防火墙放行3306端口,并登录数据库连接工具校验
firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --reload
![enter image description here](/tfl/pictures/202208/tapd_46649215_1659350677_28.png)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值