当前位置:   article > 正文

Linux(CentOS7)离线安装mysql_libaio-devel-0.3.109 (x86_64).下载

libaio-devel-0.3.109 (x86_64).下载
  1. 安装依赖库
    libaio-0.3.109-13.el7.x86_64.rpm
    libao-1.1.0-8.el7.x86_64.rpm

    wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libaio-devel-0.3.109-13.el7.x86_64.rpm
    wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libao-1.1.0-8.el7.x86_64.rpm
    rpm -ivh libaio-devel-0.3.109-13.el7.x86_64.rpm 
    rpm -ivh libao-1.1.0-8.el7.x86_64.rpm
    
    • 1
    • 2
    • 3
    • 4
  2. 下载mysql,并解压: 官网:https://dev.mysql.com/downloads/mysql/

    # 解压
    tar mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz
    # 移动并改名
    mv mysql-5.7.28-linux-glibc2.12-x86_64 /usr/local/mysql
    
    • 1
    • 2
    • 3
    • 4
  3. 添加用户和组,进入/usr/local目录下

    groupadd mysql
    useradd -r -g mysql mysql
    
    • 1
    • 2
  4. 创建mysqldata目录

    mkdir /usr/local/mysql/data/
    
    • 1
  5. 新建my.cnf文件 路径为/etc/my.cnf

    vim /etc/my.cnf
    
    • 1

    my.cnf文件内容如下:

    [client]
    port = 3306
    socket = /tmp/mysql.sock
    
    [mysqld]
    init-connect='SET NAMES utf8'
    basedir=/usr/local/mysql
    datadir=/usr/local/mysql/data
    socket=/tmp/mysql.sock
    max_connections=50
    character-set-server=utf8
    default-storage-engine=INNODB
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
  6. 配置mysql环境变量

    # 修改权限
    chmod +x /usr/local/mysql/bin/*
    
    # 编辑配置文件
    vim /etc/profile
    # 配置环境变量
    export PATH=$PATH:/usr/local/mysql/bin
    export PATH=$PATH:/usr/local/mysql/support-files
    # 使配置文件生效
    source /etc/profile
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
  7. 初始化mysql

    mysqld --initialize-insecure --user=mysql  --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
    
    • 1
  8. 修改文件夹权限

    chown -R root:root /usr/local/mysql/
    chown -R mysql:mysql /usr/local/mysql/data/
    
    • 1
    • 2
  9. 启动mysql

     mysql.server start
    
    • 1

    在这里插入图片描述

  10. 修改密码

    mysql -uroot
    use mysql;
    update user set authentication_string=password('密码') where user='root';
    flush privileges;
    exit;
    
    • 1
    • 2
    • 3
    • 4
    • 5
  11. 设置外网访问

    update user set host='%' where user ='root';
    flush privileges;
    
    • 1
    • 2
  12. centos7打开远程连接防火墙

    firewall-cmd --permanent --add-port=3306/tcp
    service firewalld restart
    
    • 1
    • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/353772
推荐阅读
相关标签
  

闽ICP备14008679号