Linux下MySQL离线安装

MySQL安装

    • 相关安装包下载
    • 1、安装前准备
      • 1.1检查是否已安装
      • 1.2清理mariadb
    • 2、安装依赖
    • 3、修改操作系统限制
    • 4、解压并安装
    • 5、查看安装状态并启动
    • 6、查看临时密码
    • 7、登入数据库并修改密码
    • 8、授权远程连接
    • 9、Navicat连接测试

相关安装包下载

链接:https://pan.baidu.com/s/1RuOtncFkBOPNrcBGRxaIJg?pwd=1h8h
提取码:1h8h

1、安装前准备

1.1检查是否已安装

rpm -qa |grep  mysql                    #检查是否已安装
rpm -qa |grep  mariadb                  #系统默认自带

1.2清理mariadb

rpm -e mariadb-libs-5.5.68-1.el7.x86_64
报依赖错误则使用以下命令
yum remove  mariadb-libs-5.5.68-1.el7.x86_64

2、安装依赖

yum install libaio                #需安装
yum install perl                  #一般已安装
yum install net-tools             #一般已安装

3、修改操作系统限制

cat <<'EOF'>> /etc/security/limits.conf
*  soft  nproc 65536
*  hard  nproc 65536
*  soft  nofile 65536
*  hard  nofile 65536
EOF

4、解压并安装

tar -xzvf mysql-8.0.25-1.el7.x86_64.rpm-bundle.tar

进入mysql解压后的目录

rpm -ivh mysql-community* --force --nodeps

5、查看安装状态并启动

systemctl status mysqld
systemctl start mysqld

6、查看临时密码

grep password /var/log/mysqld.log        #查看临时密码

7、登入数据库并修改密码

在十大这里插入图片描述
修改密码

alter user 'root'@'localhost' identified by 'password';        #不能太简单

8、授权远程连接

use mysql;
select host, user, authentication_string, plugin from user;               #查看当前信息
update user set host='%' where user='root';                               #更改root的host为%
select host, user, authentication_string, plugin from user;
flush privileges; 

9、Navicat连接测试

关闭linux防火墙或添加防火墙策略,使用navicat进行连接测试,如果远程连接报错如下
Error: 1251
Message: Client does not support authentication protocol requested by server; consider upgrading MySQL client
进入数据库运行以下命令文章来源地址https://uudwc.com/A/jV2x9

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

原文地址:https://blog.csdn.net/weixin_53893423/article/details/130707148

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请联系站长进行投诉反馈,一经查实,立即删除!

h
上一篇 2023年08月28日 13:08
Windows 上安装和配置 Flutter
下一篇 2023年08月28日 13:09