yum -y installgccgcc-c++ncurses-develperl
wget --no-check-certificate
https://cmake.org/files/v2.8/cmake-2.8.12.tar.gz
tar -zxvfcmake-2.8.12.tar.gz
cdcmake-2.8.12
./bootstrap && make && make install
mkdir -p /usr/local/MysqL
tar -zxvf MysqL-5.6.37.tar.gz
cdMysqL-5.6.37
/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/MysqL/ -DMysqL_DATADIR=/data2/MysqLdb -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMysqL_TCP_PORT=3308 -DMysqL_UNIX_ADDR=/usr/local/MysqL/data/MysqL.sock -DMysqL_USER=MysqL -DWITH_DEBUG=0
make
make install
cp/usr/local/MysqL/support-files/my-default.cnf/etc/my.cnf
##my.cnf重新配置参数,编译阶段的参数没写到这个配置文件去。
#文件配置
vim /etc/my.cnf
basedir =/usr/local/MysqL
datadir =/data2/MysqLdb
port =3308
# server_id = .....
[MysqLd_safe]
default-storage-engine=MyISAM
server-id = 1
innodb_buffer_pool_size = 21M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
#Because the MysqL server,MysqLd,must access the data directory when it runs later,you should either runMysqL_install_dbfrom the same system account that will be used for runningMysqLd
/usr/local/MysqL/scripts/MysqL_install_db --user=MysqL --basedir=/usr/local/MysqL --datadir=/data2/MysqLdb
##指定配置文件