boost_1_59_0.tar.gz cmake-2.8.12.tar.gz mysql-5.7.20.tar.gz
yum install -y gcc gcc-c++ ncurses-devel perl
groupadd mysql
useradd -r -g mysql mysql
mkdir /usr/local/mysql5.7
tar zxvf boost_1_59_0.tar.gz
mv boost_1_59_0 /usr/local/boost
#cmake --version
tar zxvf cmake-2.8.12.tar.gz
cd cmake-2.8.12
./bootstrap
make && make install
cmake --version
cd ../
mkdir -p /usr/local/mysql-5.7.20
tar zxvf mysql-5.7.20.tar.gz
cd mysql-5.7.20
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.7.20 -DWITH_BOOST=/usr/local/boost/
make && make install
#unlink /usr/local/mysql
ln -s /usr/local/mysql-5.7 /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql /usr/local/mysql-5.7
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
vim /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
source /etc/profile
#echo $MYSQL_HOME
mysql -V
#/etc/my.cnf
[mysql]
default-character-set = utf8
socket=/data2/mysql5.7/run/mysql.sock
[mysqld]
basedir=/usr/local/mysql
datadir=/data1/mysql5.7
user=mysql
symbolic-links=0
lower-case-table_names=1
socket=/data2/mysql5.7/run/mysql.sock
log-error=/data2/mysql5.7/log/mysqld.log
pid-file=/data2/mysql5.7/log/mysqld.pid
max-allowed-packet=32M
open-files-limit=65535
server-id = 20
log-bin = /data2/mysql5.7/log/mysql-bin
auto-increment-increment = 2
auto-increment-offset = 2
log-slave-updates = 1
relay-log = /data2/mysql5.7/log/relay-bin
relay-log-purge = 1
read_only=0
chkconfig mysqld on
chkconfig mysqld --list
service mysql start
mysqld --initialize-insecure --user=mysql --datadir={$datadir}
# service mysql restart