Centos下编译mysql5.6.16
Centos下编译mysql5.6.16
一,下载
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.16.tar.gz
tar -zxvf mysql-5.6.16.tar.gz
cd mysql-5.6.16
二,编译
cmake
-DCMAKE_INSTALL_PREFIX=/data/apps/mysql5.6.16
-DMYSQL_DATADIR=/data/mysqldata
-DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_MEMORY_STORAGE_ENGINE=1
-DWITH_READLINE=1
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock
-DMYSQL_TCP_PORT=3306
-DENABLED_LOCAL_INFILE=1
-DWITH_PARTITION_STORAGE_ENGINE=1
-DEXTRA_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
make && make install
三,配置&&初始化
cp ./support-files/my-default.cnf /etc/my.cnf
groupadd mysql
useradd -g mysql mysql
chown -R mysql:mysql /data/apps/mysql5.6.16
/data/apps/mysql5.6.16/scripts/mysql_install_db --user=mysql --basedir=/data/apps/mysql5.6.16 --datadir=/data/mysqldata
/data/apps/mysql5.6.16/bin/mysqld_safe --user=mysql &
/data/apps/mysql5.6.16/bin/mysqladmin -uroot password mypassword
四,加入到系统服务
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 700 /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on