Sles11_sp2 64bit MySQL5.6.17编译安装

MySQL下载地址:http://downloads.mysql.com/archives/community/

           或:http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz

cmake下载地址:http://www.cmake.org/files/v3.0/

rpm -ivh linux-kernel-headers-2.6.32-1.4.13.noarch.rpm
rpm -ivh glibc-devel-2.11.3-17.31.1.x86_64.rpm
rpm -ivh libstdc++43-devel-4.3.4_20091019-0.22.17.x86_64.rpm
rpm -ivh libstdc++-devel-4.3-62.198.x86_64.rpm
rpm -ivh gcc43-4.3.4_20091019-0.22.17.x86_64.rpm
rpm -ivh gcc-4.3-62.198.x86_64.rpm
rpm -ivh gcc43-c++-4.3.4_20091019-0.22.17.x86_64.rpm
rpm -ivh gcc-c++-4.3-62.198.x86_64.rpm
rpm -ivh sysstat-8.1.5-7.32.1.x86_64.rpm
rpm -ivh libaio-devel-0.3.109-0.1.46.x86_64.rpm  

# tar xvf mysql-5.6.19.tar.gz -C /usr/src/
# tar xvf cmake-3.0.1.tar.gz -C /usr/src/

# cd /usr/src

1安装cmake
    # cd cmake-3.0.1/
    # ./configure --prefix=/usr/local/cmake
    # gmake
    # make install
    # vim /etc/profile
        export PATH=$PATH:/usr/local/cmake/bin:/usr/local/mysql/bin:/usr/local/mysql/lib

    # source /etc/profile
2安装mysql
    # cd ../mysql-5.6.19/
    # cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/usr/local/mysql/etc -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

    # make
    # make install
    # chown nobody.nobody -R /usr/local/mysql
    # cd /usr/local/mysql/

    # mkdir /usr/local/mysql/etc
    # vim etc/my.cnf 

        [mysqld]

        basedir=/opt/mysql
        datadir=/data/mysql/data
        log-bin=mysql-bin
        skip-host-cache
        skip-name-resolve  

    # chown -R mysql.mysql /usr/local/mysql

    # ./scripts/mysql_install_db --user=nobody --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/
    # cp support-files/mysql.server /etc/init.d/mysqld
    # chmod 755 /etc/init.d/mysqld

    # chkconfig --add mysqld            添加到开机启动

你可能感兴趣的:(mysql,编译安装5.6.17)