curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && \ yum clean all &&\ yum install -y wget gcc gcc-c++ automake autoconf make cmake bison-devel ncurses-devel libaio-devel &&\ mkdir /server/tools /application -p &&\ cd /server/tools &&\ useradd mysql -s /sbin/nologin -M && \ wget https://www.chenleilei.net/soft/mysql-boost-5.7.20.tar.gz &&\ tar xf mysql-boost-5.7.20.tar.gz &&\ rm -f mysql-boost-5.7.20.tar.gz &&\ cd mysql-5.7.20 &&\ cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.7.20 \ -DMYSQL_DATADIR=/application/mysql-5.7.20/data \ -DMYSQL_UNIX_ADDR=/application/mysql-5.7.20/tmp/mysql.sock \ -DDOWNLOAD_BOOST=1 -DWITH_BOOST=./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 &&\ make && make install &&\ chown -R mysql.mysql /application/mysql-5.7.20 &&\ /application/mysql-5.7.20/bin/mysqld --initialize-insecure --user=mysql --basedir=/application/mysql-5.7.20 --datadir=/application/mysql-5.7.20/data echo -e "[mysqld] \ basedir=/application/mysql \ datadir=/application/mysql-5.7.20/data \ socket=/tmp/mysql.sock \ log_error=/var/log/mysql.log \ user=mysql \ port=3306 \ [client] \ socket=/tmp/mysql.sock" >/etc/my.cnf rm -rf /server/tools/mysql-5.7.20 && \ rm -rf /var/cache/yum/* echo 'PATH=/application/mysql/bin/:$PATH' >>/etc/profile && \ source /etc/profile && \ \cp /application/mysql-5.7.20/support-files/mysql.server /etc/init.d/mysqld && \ mkdir /application/mysql-5.7.20/tmp -p && \ ln -s /application/mysql-5.7.20 /application/mysql && \ /etc/init.d/mysqld start
mysql5.7.20编译安装
原创
©著作权归作者所有:来自51CTO博客作者妙手折花的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
CentOS 7 安装MySQL5.7.20 及(忘记密码修改密码)
w数据库是mariadb, 但是 好多用的都是
mysql 数据库 修改密码