mysql 5.5.32 源码 cmake 编译 安装

Posted

tags:

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

  1. cmake工具安装
    yum install cmake -y
    依赖包 yum install ncurses-devel -y
  2. 开始安装mysql
    创建用户和组
    groupadd mysql
    useradd mysql -s /sbin/nologin -M -g mysql
  3. 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

  4. make && make install
  5. ln -s /application/mysql-5.5.32/ /application/mysql
  6. echo ‘export PATH=/application/mysql/bin:$PATH‘ >> /etc/profile
  7. source /etc/profile
  8. cp /application/mysql/support-files/my-small.cnf /etc/my.cnf
  9. chown -R mysql.mysql /application/mysql/data/
  10. chown -R 1777 /tmp/
  11. cd /application/mysql/scripts/
  12. chmod +x mysql_install_db
  13. ./mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
  14. cp support-files/mysql.server /etc/init.d/mysqld
  15. chmod +x /etc/init.d/mysqld
  16. netstat -lntup|grep 3306
  17. mysql

以上是关于mysql 5.5.32 源码 cmake 编译 安装的主要内容,如果未能解决你的问题,请参考以下文章

cmake源码编译安装mysql-5.5.32:多实例遇到的坑

cmake编译安装mysql

CentOS6.7通过cmake编译安装mysql5.5.32

MySQL-5.5 cmake编译安装

12步安装MySQL-Server5.5.32

mysql安装与调优