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

mysql 5.5.32 源码 cmake 编译 安装

时间:2018-04-04 23:19:41      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:mysql   5.5.32   源码   cmak   

  • cmake工具安装
    yum install cmake -y
    依赖包 yum install ncurses-devel -y
  • 开始安装mysql
    创建用户和组
    groupadd mysql
    useradd mysql -s /sbin/nologin -M -g mysql
  • tar zxf mysql-5.5.32.tar.gz
    cd mysql-5.5.32
    cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32 \
    -DMYSQL_DATADIR=/application/mysql-5.5.32/data \
    -DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/tmp/mysql.sock \
    -DDEFAULT_CHARSET=utf8 \
    -DDEFAULT_COLLATION=utf8_general_ci \
    -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
    -DENABLED_LOCAL_INFILE=ON \
    -DWITH_INNOBASE_STORAGE_ENGINE=1 \
    -DWITH_FEDERATED_STORAGE_ENGINE=1 \
    -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
    -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
    -DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
    -DWITH_FAST_MUTEXES=1 \
    -DWITH_ZLIB=bundled \
    -DENABLED_LOCAL_INFILE=1 \
    -DWITH_READLINE=1 \
    -DWITH_EMBEDDED_SERVER=1 \
    -DWITH_DEBUG=0

  • make && make install
  • ln -s /application/mysql-5.5.32/ /application/mysql
  • echo ‘export PATH=/application/mysql/bin:$PATH‘ >> /etc/profile
  • source /etc/profile
  • cp /application/mysql/support-files/my-small.cnf /etc/my.cnf
  • chown -R mysql.mysql /application/mysql/data/
  • chown -R 1777 /tmp/
  • cd /application/mysql/scripts/
  • chmod +x mysql_install_db
  • ./mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
  • cp support-files/mysql.server /etc/init.d/mysqld
  • chmod +x /etc/init.d/mysqld
  • netstat -lntup|grep 3306
  • mysql
  • mysql 5.5.32 源码 cmake 编译 安装

    标签:mysql   5.5.32   源码   cmak   

    原文地址:http://blog.51cto.com/20170401/2094872

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