当前位置:   article > 正文

Linux下MySQL离线安装_linux离线安装mysql

linux离线安装mysql

相关安装包下载

链接:https://pan.baidu.com/s/18KX3fHg49UmudFxjvuwt8w?pwd=38wx
提取码:38wx

1、安装前准备

1.1检查是否已安装

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

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
  • 1
  • 2
  • 3

2、安装依赖

yum install libaio                #需安装
yum install perl                  #一般已安装
yum install net-tools             #一般已安装
  • 1
  • 2
  • 3

3、修改操作系统限制

cat <<'EOF'>> /etc/security/limits.conf
*  soft  nproc 65536
*  hard  nproc 65536
*  soft  nofile 65536
*  hard  nofile 65536
EOF
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

4、解压并安装

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

进入mysql解压后的目录

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

5、查看安装状态并启动

systemctl status mysqld
systemctl start mysqld
  • 1
  • 2

6、查看临时密码

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

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

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

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

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; 
  • 1
  • 2
  • 3
  • 4
  • 5

9、Navicat连接测试

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

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/809223
推荐阅读
相关标签
  

闽ICP备14008679号