zoukankan      html  css  js  c++  java
  • 离线安装MySQL5.7

    无网络环境下安装MySQL5.7 

    前提:

    1、系统环境:CentOS 7 64bit

    2、需要的rpm包已经在本地

    安装:

    1、下载需要的rpm包:

    mysql-community-client-5.7.18-1.el7.x86_64.rpm
    mysql-community-common-5.7.18-1.el7.x86_64.rpm
    mysql-community-libs-5.7.18-1.el7.x86_64.rpm
    mysql-community-server-5.7.18-1.el7.x86_64.rpm
    numactl-2.0.9-6.el7_2.x86_64.rpm
    numactl-devel-2.0.9-6.el7_2.x86_64.rpm
    numactl-libs-2.0.9-6.el7_2.x86_64.rpm
    perl-Data-Dumper-2.145-3.el7.x86_64.rpm
    libaio-0.3.109-13.el7.x86_64.rpm

    推荐一个比较不错的下载网站:https://pkgs.org/

    2、安装rpm:

    注意安装顺序

    rpm -ivh libaio-0.3.109-13.el7.x86_64.rpm
    rpm -ivh perl-Data-Dumper-2.145-3.el7.x86_64.rpm
    rpm -ivh numactl-libs-2.0.9-6.el7_2.x86_64.rpm
    rpm -ivh numactl-devel-2.0.9-6.el7_2.x86_64.rpm
    rpm -ivh numactl-2.0.9-6.el7_2.x86_64.rpm
    rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
    rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
    rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
    rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm

    若安装时出现冲突,需要将以安装的卸载掉(rpm -e),然后继续安装。

    安装完毕后,启动mysql:

    service mysqld start

    启动后进入MySQL时,会提示输入密码,该密码是初次安装是默认生成并保存在/var/log/mysqld.log中,可以通过一下命令查看:

    cat /var/log/mysqld.log | grep password

    输入密码登陆后,执行SQL语句时,会提示让修改密码,执行以下三句:

    1: SET PASSWORD = PASSWORD('new password');
    2: ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
    3: flush privileges;

    退出后再次登陆,OK。

  • 相关阅读:
    python之进程和线程2
    Python学习笔记7:yield生成迭代器
    Python学习笔记6:装饰器
    Python学习你急5:文件打开与处理
    Python学习笔记4:集合方法
    Python学习笔记3:字典方法
    Python学习笔记2:列表操作方法详解
    Python学习笔记1:字符串方法
    番外篇:Vim使用方法
    Day12: 正则表达式
  • 原文地址:https://www.cnblogs.com/ahaii/p/7323524.html
Copyright © 2011-2022 走看看