下载软件到usr/local目录下:
cd /usr/local wget http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.19.tar.gz
wget http://www.cmake.org/files/v2.8/cmake-2.8.11.1.tar.gz
wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz wget http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11.tar.gz
带boost的mysql源码安装
1、安装依赖包
yum -y install make gcc-c++ cmake bison-devel ncurses-devel bison perl perl-devel perl perl-devel
2、编译安装cmake
cd /usr/local/src
tar -xvf cmake-2.8.11.1.tar.gz
cd cmake-2.8.11.1
./bootstrap
make && make install
3、解压到/usr/local目录下
tar -zxvf mysql-boost-5.7.19.tar.gz -C /usr/local/mysql
4、创建mysql组和用户
groupadd mysql useradd -r -g mysql -s /bin/false mysql
5、数据库规划
mysql软件目录 : /usr/local/mysql
mysql数据目录:/home/data/mysql/data/
mysql日志目录:/home/data/mysql/log/
mkdir -p /home/data/mysql/data
mkdir -p /usr/local/mysql
mkdir -p/home/data/mysql/log/
6、编译mysql
cd /usr/local/mysql/ cmake -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=boost -DMYSQL_DATADIR=/home/data/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DMYSQL_USER=mysql make make install
注:make过程大约需要2小时