依赖包安装
yum -y install gcc gcc-c++ ncurses ncurses-devel cmake
创建MYSQL系统用户
groupadd mysql
useradd -g mysql mysql
boost配置
下载链接: https://pan.baidu.com/s/1ggr8N4Z 密码: dbr1
tar xzf boost_1_59_0.tar.gz
mv boost_1_59_0 /usr/local/boost
编译安装MySQL
下载链接:链接: https://pan.baidu.com/s/1pMoAGFT 密码: trd8
>mkdir -p /mysql/data
>tar xzf mysql-5.7.11.tar.gz
>cd mysql-5.7.11
>cmake -DCMAKE_INSTALL_PREFIX=/u01/mysql -DMYSQL_DATADIR=/u01/mysql/data
-DDEFAULT_CHARSET=utf8mb4
-DDEFAULT_COLLATION=utf8mb4_general_ci
-DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DWITH_MYISAM_STORAGE_ENGINE=1
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITH_MEMORY_STORAGE_ENGINE=1
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=/usr/local/boost/boost
>make && make install
配置开机启动项
cp /u01/mysql/support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld
配置my.cnf(略)
初始化数据
/u01/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/u01/mysql --datadir=/u01/mysql/data
启动数据库
service mysqld start