mysql5.7编译安装
作者:互联网
#依赖
yum install -y gcc gcc-c++ automake autoconf
yum -y install make cmake bison-devel ncurses-devel libaio-devel
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
tar xf /tools/boost_1_65_1.tar.gz -C /usr/local/
mv /tools/boost_1_65_1 /usr/local/
tar -xf /tools/mysql-5.7.17.tar.gz
cd /tools/mysql-5.7.17/
#预编译
cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.7.17 \
-DMYSQL_DATADIR=/application/mysql-5.7.17/data \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/local/boost_1_65_1/boost \
-DSYSCONFDIR=/etc \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_ZLIB=bundled \
-DWITH_SSL=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLE_DOWNLOADS=1 \
-DWITH_DEBUG=0
#编译 && 安装
内存必须 > 2GB
make && make install
#授权
useradd -r -s /sbin/nologin mysql
mysql-5.7.17]# chown -R mysql.mysql /application/mysql-5.7.17
#初始化
/application/mysql-5.7.17/bin/mysqld --initialize --user=mysql --basedir=/application/mysql-5.7.17 --datadir=/application/mysql-5.7.17/data
记录初始密码(一定要记录!!!)
#拷贝配置文件和启动文件
cp /application/mysql-5.7.17/support-files/my-default.cnf /etc/my.cnf
cp /application/mysql-5.7.17/support-files/mysql.server /etc/init.d/mysqld
#启动
/etc/init.d/mysqld start
YYQ运维技术博客_运维的工作学习之路
https://www.yeyouqing.top
https://yeyouqing.top
yeyouqing.top
www.yeyouqing.top
标签:ENGINE,application,17,5.7,mysql5.7,编译,mysql,DWITH,安装 来源: https://blog.csdn.net/at1358/article/details/114921902