[筆記] 手動編譯MySQL

  1. Download mysql source
  2. tar xvf mysql.tar
  3. yum -y install cmake
  4. Compile
    Follow guide here: http://forge.mysql.com/wiki/CMake
    mkdir bld
    cd bld
    cmake ..
    make
    sudo make install
  5. Set permissions of linux user and group
    Follow guide here http://dev.mysql.com/doc/refman/5.6/en/binary-installation.html
    groupadd mysql
    useradd -r -g mysql mysql
    cd /usr/local
    tar zxvf /path/to/mysql-VERSION-OS.tar.gz
    ln -s full-path-to-mysql-VERSION-OS mysql
    cd mysql
    chown -R mysql .
    chgrp -R mysql .
    scripts/mysql_install_db –user=mysql
    chown -R root .
    chown -R mysql data
  6. Copy init script and configuration file
    cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
    chmod +x /etc/init.d/mysqld
    chkconfig mysqld on
    cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
  7. Start the service
    service mysqld start
  8. Run the secure installation
    /usr/local/mysql/bin/mysql_secure_installation
This entry was posted in 筆記 and tagged , , , . Bookmark the permalink.

Comments are closed.