mysql5.7.20安裝
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
cd /root
wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
mkdir -p /usr/local/boost
tar xf boost_1_59_0.tar.gz(5.7才安裝)
mv boost_1_59_0 /usr/local/boost/
tar xf mysql-5.7.20.tar.gz
cd mysql-5.7.20
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_BOOST=/usr/local/boost -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make install
groupadd mysql
useradd -g mysql -s /sbin/nologin -M mysql
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql
bin/mysqld --initialize-insecure --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
cp /etc/my.cnf /etc/my.cnf.bak
vim /etc/profile.d/mysqld.sh
. /etc/profile.d/mysqld.sh
mkdir /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
vim /etc/my.cnf
service mysqld start
mysql -u root
mysql> SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘newpass‘);
mysql5.7.20安裝