1. 程式人生 > >mysql 5.5.32 源碼 cmake 編譯 安裝

mysql 5.5.32 源碼 cmake 編譯 安裝

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 編譯 安裝