码迷,mamicode.com
首页 > 数据库 > 详细

centos7源码安装mysql5.7

时间:2019-01-03 10:58:15      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:soft   tcp   hub   with   useradd   download   ref   lib   cmake   

  • 下载:
    https://dev.mysql.com/downloads/mysql/
    或
    https://github.com/dollarphper/soft/blob/master/mysql/mysql-boost-5.7.24.tar.gz
  • 安装依赖:
    yum -y install cmake gcc gcc-c++ ncurses  ncurses-devel  libaio-devel  openssl openssl-devel
  • 创建用户:
    useradd mysql -s /sbin/nologin -M
  • 创建文件夹:
    mkdir -p /usr/local/mysql/data
  • 解压:
    tar  -xzf  mysql-boost-5.7.24.tar.gz
  • 编译安装:
    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
  • 修改所属主为mysql:
    chown  -R  mysql.mysql  /usr/local/mysql
  • 修改配置文件:
    vim /etc/my.cnf
    [mysqld]
    server-id=1
    port=3306
    basedir=/usr/local/mysql
    datadir=/usr/local/mysql/data
    ngram_token_size=2
  • 初始化:
    /usr/local/mysql/bin/mysqld  --initialize-insecure  --user=mysql --datadir=/usr/local/mysql/data
  • 启动服务:
    /usr/local/mysql/bin/mysqld_safe  --user=mysql  &
  • centos7源码安装mysql5.7

    标签:soft   tcp   hub   with   useradd   download   ref   lib   cmake   

    原文地址:http://blog.51cto.com/12173069/2338090

    (0)
    (0)
       
    举报
    评论 一句话评论(0
    登录后才能评论!
    © 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
    迷上了代码!