centos7源码安装mysql5.7

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7源码安装mysql5.7相关的知识,希望对你有一定的参考价值。

  1. 下载:
    https://dev.mysql.com/downloads/mysql/
    或
    https://github.com/dollarphper/soft/blob/master/mysql/mysql-boost-5.7.24.tar.gz
  2. 安装依赖:
    yum -y install cmake gcc gcc-c++ ncurses  ncurses-devel  libaio-devel  openssl openssl-devel
  3. 创建用户:
    useradd mysql -s /sbin/nologin -M
  4. 创建文件夹:
    mkdir -p /usr/local/mysql/data
  5. 解压:
    tar  -xzf  mysql-boost-5.7.24.tar.gz
  6. 编译安装:
    cd  mysql-5.7.24
    cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DMYSQL_TCP_PORT=3306 -DWITH_BOOST=./boost
    make  &&  make  install
  7. 修改所属主为mysql:
    chown  -R  mysql.mysql  /usr/local/mysql
  8. 修改配置文件:
    vim /etc/my.cnf
    [mysqld]
    server-id=1
    port=3306
    basedir=/usr/local/mysql
    datadir=/usr/local/mysql/data
    ngram_token_size=2
  9. 初始化:
    /usr/local/mysql/bin/mysqld  --initialize-insecure  --user=mysql --datadir=/usr/local/mysql/data
  10. 启动服务:
    /usr/local/mysql/bin/mysqld_safe  --user=mysql  &

以上是关于centos7源码安装mysql5.7的主要内容,如果未能解决你的问题,请参考以下文章

centos7 mysql5.7.17源码安装

centos7源码安装mysql5.7怎么卸载

centos7源码安装mysql5.7

CentOS7.4下MySQL5.7.28源码方式安装

Centos7源码安装MySQL5.7

CentOS7.5源码shell脚本自动安装MySQL5.7.28多实例