{"id":123,"date":"2020-10-26T12:03:08","date_gmt":"2020-10-26T04:03:08","guid":{"rendered":"https:\/\/www.92k.xin\/?p=123"},"modified":"2020-10-26T14:36:20","modified_gmt":"2020-10-26T06:36:20","slug":"centos7%e4%b8%8bmysql8-%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/www.92k.xin\/?p=123","title":{"rendered":"CentOS7\u4e0bMysql8 \u5b89\u88c5\u811a\u672c"},"content":{"rendered":"\n

Mysql8\u5b89\u88c5\u9700\u8981\u9ad8\u7248\u672c\u7684GCC\uff0cCentOS7\u4e0b\u9762\u7684GCC\u7248\u672c\u4e3a4.8.3\uff0c\u4e3a\u4e86\u65b9\u4fbf\uff0c\u6211\u4eec\u7528yum\u7684SCL\u6765\u5347\u7ea7GCC\u3002<\/p>\n\n\n\n

scl\u8f6f\u4ef6\u96c6(Software Collections),\u662f\u4e3a\u4e86\u7ed9 RHEL\/CentOS \u7528\u6237\u63d0\u4f9b\u4e00\u79cd\u4ee5\u65b9\u4fbf\u3001\u5b89\u5168\u5730\u5b89\u88c5\u548c\u4f7f\u7528\u5e94\u7528\u7a0b\u5e8f\u548c\u8fd0\u884c\u65f6\u73af\u5883\u7684\u591a\u4e2a\uff08\u800c\u4e14\u53ef\u80fd\u662f\u66f4\u65b0\u7684\uff09\u7248\u672c\u7684\u65b9\u5f0f\uff0c\u540c\u65f6\u907f\u514d\u628a\u7cfb\u7edf\u641e\u4e71\u3002<\/p>\n\n\n\n

yum install centos-release-scl scl-utils-build<\/pre><\/div>\n\n\n\n

\u5347\u7ea7\u4e4b\u540e\uff0c\u6211\u4eec\u6765\u770b\u4e0b\u6709\u54ea\u4e9bGCC\u53ef\u4ee5\u4f7f\u7528\u7684\u3002<\/p>\n\n\n\n

\u6267\u884c\u547d\u4ee4\uff1a <\/p>\n\n\n\n

yum list all --enablerepo='centos-sclo-rh'|grep gcc<\/pre>\n\n\n\n

\u663e\u793a\u5982\u4e0b\uff1a<\/p>\n\n\n\n

libgcc.x86_64                              4.8.5-39.el7           @anaconda     \ncompat-gcc-44.x86_64                       4.4.7-8.el7            base          \ncompat-gcc-44-c++.x86_64                   4.4.7-8.el7            base          \ncompat-gcc-44-gfortran.x86_64              4.4.7-8.el7            base          \ndevtoolset-7-gcc.x86_64                    7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-7-gcc-c++.x86_64                7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-7-gcc-gdb-plugin.x86_64         7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-7-gcc-gfortran.x86_64           7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-7-gcc-plugin-devel.x86_64       7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-7-libgccjit.x86_64              7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-7-libgccjit-devel.x86_64        7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-7-libgccjit-docs.x86_64         7.3.1-5.16.el7         centos-sclo-rh\ndevtoolset-8-gcc.x86_64                    8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-8-gcc-c++.x86_64                8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-8-gcc-gdb-plugin.x86_64         8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-8-gcc-gfortran.x86_64           8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-8-gcc-plugin-devel.x86_64       8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-8-libgccjit.x86_64              8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-8-libgccjit-devel.x86_64        8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-8-libgccjit-docs.x86_64         8.3.1-3.2.el7          centos-sclo-rh\ndevtoolset-9-gcc.x86_64                    9.3.1-2.el7            centos-sclo-rh\ndevtoolset-9-gcc-c++.x86_64                9.3.1-2.el7            centos-sclo-rh\ndevtoolset-9-gcc-gdb-plugin.x86_64         9.3.1-2.el7            centos-sclo-rh\ndevtoolset-9-gcc-gfortran.x86_64           9.3.1-2.el7            centos-sclo-rh\ndevtoolset-9-gcc-plugin-devel.x86_64       9.3.1-2.el7            centos-sclo-rh\ndevtoolset-9-libgccjit.x86_64              9.3.1-2.el7            centos-sclo-rh\ndevtoolset-9-libgccjit-devel.x86_64        9.3.1-2.el7            centos-sclo-rh\ndevtoolset-9-libgccjit-docs.x86_64         9.3.1-2.el7            centos-sclo-rh\ngcc.x86_64                                 4.8.5-39.el7           base          \ngcc-c++.x86_64                             4.8.5-39.el7           base          \ngcc-gfortran.x86_64                        4.8.5-39.el7           base          \ngcc-gnat.x86_64                            4.8.5-39.el7           base          \ngcc-go.x86_64                              4.8.5-39.el7           base          \ngcc-objc.x86_64                            4.8.5-39.el7           base          \ngcc-objc++.x86_64                          4.8.5-39.el7           base          \ngcc-plugin-devel.x86_64                    4.8.5-39.el7           base          \nlibgcc.i686                                4.8.5-39.el7           base          \nrelaxngcc.noarch                           1.12-6.el7             base          \nrelaxngcc-javadoc.noarch                   1.12-6.el7             base<\/pre><\/div>\n\n\n\n

\u6211\u4eec\u5b89\u88c5\u4e00\u4e2a\u9ad8\u7248\u672c\u7684GCC<\/p>\n\n\n\n

yum -y install devtoolset-9-gcc.x86_64  devtoolset-9-gcc-c++.x86_64 devtoolset-9-gcc-gdb-plugin.x86_64 devtoolset-9-gcc-plugin-devel.x86_64<\/pre><\/div>\n\n\n\n

\u6211\u4eec\u673a\u5668\u56e0\u4e3a\u65b0\u88c5\u6ca1\u6709gcc\u547d\u4ee4\uff0c\u4e0b\u9762\u6211\u4eec\u901a\u8fc7SCL\u542f\u7528GCC\u7684\u9ad8\u7248\u672c<\/p>\n\n\n\n

scl enable devtoolset-9 bash<\/p>\n\n\n\n

\u4e0b\u9762\u6211\u4eec\u6765\u770b\u4e0bGCC\u7684\u7248\u672c<\/p>\n\n\n\n

\"%title\u63d2\u56fe%num\"
\u73b0\u5728GCC\u7248\u672c\u4e3a9\u4e86\uff0c\u8f93\u5165exit\uff0c\u6062\u590d\u6b63\u5e38\u3002<\/figcaption><\/figure>\n\n\n\n

\u4f7f\u7528exit \u9000\u51fa\u5f53\u524dscl\u7248\u672c\u7684bash\u73af\u5883\u3002\u6211\u4eec\u6682\u65f6\u4e0d\u9000\u51fa\uff0c\u6548\u679c\u6211\u4eec\u53ef\u4ee5\u770b\u4e00\u4e0b\u4e0a\u56fe\u3002<\/p>\n\n\n\n

\u4e0b\u9762\u6211\u4eec\u8fdb\u884cMYSQL\u4e4b\u524d\u7684\u64cd\u4f5c:\u5b89\u88c5CMAKE\uff0c\u6211\u4eec\u5728GCC9\u7684\u57fa\u7840\u4e0a\u9762\u64cd\u4f5c\u3002<\/p>\n\n\n\n

yum -y install wget openssl*\nwget https:\/\/github.com\/Kitware\/CMake\/releases\/download\/v3.18.4\/cmake-3.18.4.tar.gz\ntar -zxf cmake-3.18.4.tar.gz\ncd cmake-3.18.4\n.\/bootstrap\ngmake && make install<\/pre><\/div>\n\n\n\n

\u4e0b\u9762\u6211\u4eec\u8fdb\u884cMYSQL8\u7684\u811a\u672c\u7f16\u8bd1\u5b89\u88c5<\/p>\n\n\n\n

yum -y install git ncurses-devel\nwget https:\/\/downloads.mysql.com\/archives\/get\/p\/23\/file\/mysql-8.0.21.tar.gz\ntar -zxf mysql-8.0.21.tar.gz\ncd mysql-8.0.21\ncmake -DWITH_BOOST=\/tmp -DCMAKE_INSTALL_PREFIX=\/web\/mysql -DWITH_INNODB_MEMCACHED=ON -DDOWNLOAD_BOOST=1 -DFORCE_INSOURCE_BUILD=1\nmake -j8 && make install \n<\/pre><\/div>\n\n\n\n

\u5185\u5b58\u4e0d\u591f\u7684\u670b\u53cb\uff0c\u53ef\u4ee5\u5c06make -j8 8\u964d\u4f4e\uff0c\u4e0d\u8fc7\u7f16\u8bd1\u65f6\u95f4\u4f1a\u589e\u52a0\u3002\u53cd\u6b63\u6211\u5728\u7f16\u8bd1\u4e2d\uff0c\u51fa\u73b0\u4e86\u5185\u5b58\u4e0d\u8db3\u7684\u60c5\u51b5\uff0c\u91cd\u65b0make\u7684\u3002<\/p>\n\n\n\n

boost\u7248\u672c\u7528\u76841.72.0\u7248\u672c\uff0c\u7f51\u7edc\u73af\u5883\u4e0d\u597d\u7684\u7ae5\u978b\uff0c\u53ef\u4ee5\u5148\u4e0b\u8f7d\u5230 \/tmp\/\u76ee\u5f55\u3002<\/p>\n\n\n\n

https:\/\/sourceforge.net\/project\/boost\/boost\/1.72.0\/boost_1_72_0.tar.gz<\/a><\/p>\n\n\n\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

Mysql8\u5b89\u88c5\u9700\u8981\u9ad8\u7248\u672c\u7684GCC\uff0cCentOS7\u4e0b\u9762\u7684GCC\u7248\u672c\u4e3a4.8.3\uff0c\u4e3a\u4e86\u65b9\u4fbf\uff0c\u6211\u4eec\u7528yum\u7684SCL… <\/p>\n