CentOS7源码编译安装MySQL5.7

下载

wget -c https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.31.tar.gz

或者
wget -c https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.31.tar.gz

本次是安装mysql-boost-5.7.31.tar.gz

安装依赖包

[root@mysql001 mysql-5.7.31]# yum install -y  gcc gcc-c++ cmake ncurses ncurses-devel bison
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.huaweicloud.com
 * updates: mirror.bit.edu.cn
软件包 ncurses-5.9-14.20130511.el7_4.x86_64 已安装并且是最新版本
正在解决依赖关系
--> 正在检查事务
---> 软件包 bison.x86_64.0.3.0.4-2.el7 将被 安装
--> 正在处理依赖关系 m4 >= 1.4,它被软件包 bison-3.0.4-2.el7.x86_64 需要
---> 软件包 cmake.x86_64.0.2.8.12.2-2.el7 将被 安装
--> 正在处理依赖关系 libarchive.so.13()(64bit),它被软件包 cmake-2.8.12.2-2.el7.x86_64 需要
---> 软件包 gcc.x86_64.0.4.8.5-39.el7 将被 安装
--> 正在处理依赖关系 cpp = 4.8.5-39.el7,它被软件包 gcc-4.8.5-39.el7.x86_64 需要
--> 正在处理依赖关系 glibc-devel >= 2.2.90-12,它被软件包 gcc-4.8.5-39.el7.x86_64 需要
--> 正在处理依赖关系 libmpfr.so.4()(64bit),它被软件包 gcc-4.8.5-39.el7.x86_64 需要
--> 正在处理依赖关系 libmpc.so.3()(64bit),它被软件包 gcc-4.8.5-39.el7.x86_64 需要
---> 软件包 gcc-c++.x86_64.0.4.8.5-39.el7 将被 安装
--> 正在处理依赖关系 libstdc++-devel = 4.8.5-39.el7,它被软件包 gcc-c++-4.8.5-39.el7.x86_64 需要
---> 软件包 ncurses-devel.x86_64.0.5.9-14.20130511.el7_4 将被 安装
--> 正在检查事务
---> 软件包 cpp.x86_64.0.4.8.5-39.el7 将被 安装
---> 软件包 glibc-devel.x86_64.0.2.17-307.el7.1 将被 安装
--> 正在处理依赖关系 glibc-headers = 2.17-307.el7.1,它被软件包 glibc-devel-2.17-307.el7.1.x86_64 需要
--> 正在处理依赖关系 glibc-headers,它被软件包 glibc-devel-2.17-307.el7.1.x86_64 需要
---> 软件包 libarchive.x86_64.0.3.1.2-14.el7_7 将被 安装
---> 软件包 libmpc.x86_64.0.1.0.1-3.el7 将被 安装
---> 软件包 libstdc++-devel.x86_64.0.4.8.5-39.el7 将被 安装
---> 软件包 m4.x86_64.0.1.4.16-10.el7 将被 安装
---> 软件包 mpfr.x86_64.0.3.1.1-4.el7 将被 安装
--> 正在检查事务
---> 软件包 glibc-headers.x86_64.0.2.17-307.el7.1 将被 安装
--> 正在处理依赖关系 kernel-headers >= 2.2.1,它被软件包 glibc-headers-2.17-307.el7.1.x86_64 需要
--> 正在处理依赖关系 kernel-headers,它被软件包 glibc-headers-2.17-307.el7.1.x86_64 需要
--> 正在检查事务
---> 软件包 kernel-headers.x86_64.0.3.10.0-1127.19.1.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==================================================================================================================================================================================
 Package                                      架构                                版本                                                 源                                    大小
==================================================================================================================================================================================
正在安装:
 bison                                        x86_64                              3.0.4-2.el7                                          base                                 674 k
 cmake                                        x86_64                              2.8.12.2-2.el7                                       base                                 7.1 M
 gcc                                          x86_64                              4.8.5-39.el7                                         base                                  16 M
 gcc-c++                                      x86_64                              4.8.5-39.el7                                         base                                 7.2 M
 ncurses-devel                                x86_64                              5.9-14.20130511.el7_4                                base                                 712 k
为依赖而安装:
 cpp                                          x86_64                              4.8.5-39.el7                                         base                                 5.9 M
 glibc-devel                                  x86_64                              2.17-307.el7.1                                       base                                 1.1 M
 glibc-headers                                x86_64                              2.17-307.el7.1                                       base                                 689 k
 kernel-headers                               x86_64                              3.10.0-1127.19.1.el7                                 updates                              9.0 M
 libarchive                                   x86_64                              3.1.2-14.el7_7                                       base                                 319 k
 libmpc                                       x86_64                              1.0.1-3.el7                                          base                                  51 k
 libstdc++-devel                              x86_64                              4.8.5-39.el7                                         base                                 1.5 M
 m4                                           x86_64                              1.4.16-10.el7                                        base                                 256 k
 mpfr                                         x86_64                              3.1.1-4.el7                                          base                                 203 k

事务概要
==================================================================================================================================================================================
安装  5 软件包 (+9 依赖软件包)

总下载量:51 M
安装大小:117 M
Downloading packages:
(1/14): bison-3.0.4-2.el7.x86_64.rpm                                                                                                                       | 674 kB  00:00:00
(2/14): cmake-2.8.12.2-2.el7.x86_64.rpm                                                                                                                    | 7.1 MB  00:00:01
(3/14): cpp-4.8.5-39.el7.x86_64.rpm                                                                                                                        | 5.9 MB  00:00:01
(4/14): gcc-c++-4.8.5-39.el7.x86_64.rpm                                                                                                                    | 7.2 MB  00:00:01
(5/14): glibc-devel-2.17-307.el7.1.x86_64.rpm                                                                                                              | 1.1 MB  00:00:00
(6/14): glibc-headers-2.17-307.el7.1.x86_64.rpm                                                                                                            | 689 kB  00:00:00
(7/14): libarchive-3.1.2-14.el7_7.x86_64.rpm                                                                                                               | 319 kB  00:00:00
(8/14): libmpc-1.0.1-3.el7.x86_64.rpm                                                                                                                      |  51 kB  00:00:00
(9/14): libstdc++-devel-4.8.5-39.el7.x86_64.rpm                                                                                                            | 1.5 MB  00:00:00
(10/14): m4-1.4.16-10.el7.x86_64.rpm                                                                                                                       | 256 kB  00:00:00
(11/14): mpfr-3.1.1-4.el7.x86_64.rpm                                                                                                                       | 203 kB  00:00:00
(12/14): gcc-4.8.5-39.el7.x86_64.rpm                                                                                                                       |  16 MB  00:00:03
(13/14): ncurses-devel-5.9-14.20130511.el7_4.x86_64.rpm                                                                                                    | 712 kB  00:00:00
(14/14): kernel-headers-3.10.0-1127.19.1.el7.x86_64.rpm                                                                                                    | 9.0 MB  00:00:10
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                              3.7 MB/s |  51 MB  00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : mpfr-3.1.1-4.el7.x86_64                                                                                                                                      1/14
  正在安装    : libmpc-1.0.1-3.el7.x86_64                                                                                                                                    2/14
  正在安装    : cpp-4.8.5-39.el7.x86_64                                                                                                                                      3/14
  正在安装    : libstdc++-devel-4.8.5-39.el7.x86_64                                                                                                                          4/14
  正在安装    : kernel-headers-3.10.0-1127.19.1.el7.x86_64                                                                                                                   5/14
  正在安装    : glibc-headers-2.17-307.el7.1.x86_64                                                                                                                          6/14
  正在安装    : glibc-devel-2.17-307.el7.1.x86_64                                                                                                                            7/14
  正在安装    : gcc-4.8.5-39.el7.x86_64                                                                                                                                      8/14
  正在安装    : m4-1.4.16-10.el7.x86_64                                                                                                                                      9/14
  正在安装    : libarchive-3.1.2-14.el7_7.x86_64                                                                                                                            10/14
  正在安装    : cmake-2.8.12.2-2.el7.x86_64                                                                                                                                 11/14
  正在安装    : bison-3.0.4-2.el7.x86_64                                                                                                                                    12/14
  正在安装    : gcc-c++-4.8.5-39.el7.x86_64                                                                                                                                 13/14
  正在安装    : ncurses-devel-5.9-14.20130511.el7_4.x86_64                                                                                                                  14/14
  验证中      : bison-3.0.4-2.el7.x86_64                                                                                                                                     1/14
  验证中      : libarchive-3.1.2-14.el7_7.x86_64                                                                                                                             2/14
  验证中      : cpp-4.8.5-39.el7.x86_64                                                                                                                                      3/14
  验证中      : glibc-devel-2.17-307.el7.1.x86_64                                                                                                                            4/14
  验证中      : gcc-c++-4.8.5-39.el7.x86_64                                                                                                                                  5/14
  验证中      : cmake-2.8.12.2-2.el7.x86_64                                                                                                                                  6/14
  验证中      : ncurses-devel-5.9-14.20130511.el7_4.x86_64                                                                                                                   7/14
  验证中      : glibc-headers-2.17-307.el7.1.x86_64                                                                                                                          8/14
  验证中      : mpfr-3.1.1-4.el7.x86_64                                                                                                                                      9/14
  验证中      : libmpc-1.0.1-3.el7.x86_64                                                                                                                                   10/14
  验证中      : m4-1.4.16-10.el7.x86_64                                                                                                                                     11/14
  验证中      : gcc-4.8.5-39.el7.x86_64                                                                                                                                     12/14
  验证中      : kernel-headers-3.10.0-1127.19.1.el7.x86_64                                                                                                                  13/14
  验证中      : libstdc++-devel-4.8.5-39.el7.x86_64                                                                                                                         14/14

已安装:
  bison.x86_64 0:3.0.4-2.el7    cmake.x86_64 0:2.8.12.2-2.el7    gcc.x86_64 0:4.8.5-39.el7    gcc-c++.x86_64 0:4.8.5-39.el7    ncurses-devel.x86_64 0:5.9-14.20130511.el7_4

作为依赖被安装:
  cpp.x86_64 0:4.8.5-39.el7               glibc-devel.x86_64 0:2.17-307.el7.1      glibc-headers.x86_64 0:2.17-307.el7.1      kernel-headers.x86_64 0:3.10.0-1127.19.1.el7
  libarchive.x86_64 0:3.1.2-14.el7_7      libmpc.x86_64 0:1.0.1-3.el7              libstdc++-devel.x86_64 0:4.8.5-39.el7      m4.x86_64 0:1.4.16-10.el7
  mpfr.x86_64 0:3.1.1-4.el7

完毕!

需要先cmake

[root@mysql001 mysql-5.7.31]# make test
make: *** 没有规则可以创建目标“test”。 停止。
[root@mysql001 mysql-5.7.31]# ll /usr/local/mysql/
ls: 无法访问/usr/local/mysql/: 没有那个文件或目录
[root@mysql001 mysql-5.7.31]# ll
总用量 528
drwxr-xr-x.  3 7161 31415     26 6月   2 19:17 boost
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 BUILD
drwxr-xr-x.  6 7161 31415   4096 6月   2 19:16 client
drwxr-xr-x.  4 7161 31415   4096 6月   2 19:16 cmake
-rw-r--r--.  1 7161 31415  29370 6月   2 19:05 CMakeLists.txt
drwxr-xr-x.  3 7161 31415     21 6月   2 19:16 cmd-line-utils
-rw-r--r--.  1 7161 31415  14529 6月   2 19:05 config.h.cmake
-rw-r--r--.  1 7161 31415  24743 6月   2 19:05 configure.cmake
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 dbug
drwxr-xr-x.  2 7161 31415     80 6月   2 19:16 Docs
-rw-r--r--.  1 7161 31415  66241 6月   2 19:05 Doxyfile-perfschema
drwxr-xr-x.  6 7161 31415   4096 6月   2 19:16 extra
drwxr-xr-x.  5 7161 31415   4096 6月   2 19:16 include
-rw-r--r--.  1 7161 31415    333 6月   2 19:05 INSTALL
drwxr-xr-x.  5 7161 31415    135 6月   2 19:16 libbinlogevents
drwxr-xr-x.  3 7161 31415     39 6月   2 19:16 libbinlogstandalone
drwxr-xr-x.  4 7161 31415    275 6月   2 19:16 libmysql
drwxr-xr-x.  3 7161 31415    204 6月   2 19:16 libmysqld
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 libservices
-rw-r--r--.  1 7161 31415 275393 6月   2 19:05 LICENSE
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:17 man
drwxr-xr-x. 10 7161 31415   4096 6月   2 19:16 mysql-test
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 mysys
drwxr-xr-x.  2 7161 31415    280 6月   2 19:16 mysys_ssl
drwxr-xr-x. 10 7161 31415    131 6月   2 19:16 packaging
drwxr-xr-x. 18 7161 31415   4096 6月   2 19:16 plugin
drwxr-xr-x.  4 7161 31415     36 6月   2 19:16 rapid
-rw-r--r--.  1 7161 31415    587 6月   2 19:05 README
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 regex
drwxr-xr-x.  4 7161 31415   4096 6月   2 19:16 scripts
drwxr-xr-x.  2 7161 31415      6 6月   2 19:15 source_downloads
drwxr-xr-x.  7 7161 31415  20480 6月   2 19:16 sql
drwxr-xr-x.  2 7161 31415    198 6月   2 19:16 sql-common
drwxr-xr-x. 13 7161 31415    175 6月   2 19:17 storage
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 strings
drwxr-xr-x.  4 7161 31415    241 6月   2 19:16 support-files
drwxr-xr-x.  2 7161 31415     98 6月   2 19:16 testclients
drwxr-xr-x.  5 7161 31415     70 6月   2 19:16 unittest
-rw-r--r--.  1 7161 31415     88 6月   2 19:05 VERSION
drwxr-xr-x.  3 7161 31415   4096 6月   2 19:16 vio
drwxr-xr-x.  2 7161 31415     32 6月   2 19:16 win
drwxr-xr-x. 11 7161 31415   4096 6月   2 19:16 zlib
[root@mysql001 mysql-5.7.31]# cd ..
[root@mysql001 mysql-source]# ll
总用量 82888
drwxr-xr-x. 36 7161 31415     4096 6月   2 19:17 mysql-5.7.31
-rw-r--r--.  1 root root  32460189 9月   4 14:13 mysql-5.7.31.tar.gz
-rw-r--r--.  1 root root  51382559 6月   2 17:18 mysql-boost-5.7.31.tar.gz

创建软链接

[root@mysql001 mysql-source]# ll
总用量 115656
drwxr-xr-x. 36 7161 31415     4096 6月   2 19:17 mysql-5.7.31
-rw-r--r--.  1 root root  35041837 9月   4 14:13 mysql-5.7.31.tar.gz
-rw-r--r--.  1 root root  51382559 6月   2 17:18 mysql-boost-5.7.31.tar.gz
[root@mysql001 mysql-source]# pwd
/opt/packages/mysql-source
[root@mysql001 mysql-source]# ln -s /opt/packages/mysql-source/mysql-5.7.31 /usr/local/mysql
[root@mysql001 mysql-source]# ll  /usr/local/mysql
lrwxrwxrwx. 1 root root 39 9月   4 14:14 /usr/local/mysql -> /opt/packages/mysql-source/mysql-5.7.31
[root@mysql001 mysql-source]# cd /usr/local/mysql
[root@mysql001 mysql]# ll
总用量 528
drwxr-xr-x.  3 7161 31415     26 6月   2 19:17 boost
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 BUILD
drwxr-xr-x.  6 7161 31415   4096 6月   2 19:16 client
drwxr-xr-x.  4 7161 31415   4096 6月   2 19:16 cmake
-rw-r--r--.  1 7161 31415  29370 6月   2 19:05 CMakeLists.txt
drwxr-xr-x.  3 7161 31415     21 6月   2 19:16 cmd-line-utils
-rw-r--r--.  1 7161 31415  14529 6月   2 19:05 config.h.cmake
-rw-r--r--.  1 7161 31415  24743 6月   2 19:05 configure.cmake
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 dbug
drwxr-xr-x.  2 7161 31415     80 6月   2 19:16 Docs
-rw-r--r--.  1 7161 31415  66241 6月   2 19:05 Doxyfile-perfschema
drwxr-xr-x.  6 7161 31415   4096 6月   2 19:16 extra
drwxr-xr-x.  5 7161 31415   4096 6月   2 19:16 include
-rw-r--r--.  1 7161 31415    333 6月   2 19:05 INSTALL
drwxr-xr-x.  5 7161 31415    135 6月   2 19:16 libbinlogevents
drwxr-xr-x.  3 7161 31415     39 6月   2 19:16 libbinlogstandalone
drwxr-xr-x.  4 7161 31415    275 6月   2 19:16 libmysql
drwxr-xr-x.  3 7161 31415    204 6月   2 19:16 libmysqld
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 libservices
-rw-r--r--.  1 7161 31415 275393 6月   2 19:05 LICENSE
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:17 man
drwxr-xr-x. 10 7161 31415   4096 6月   2 19:16 mysql-test
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 mysys
drwxr-xr-x.  2 7161 31415    280 6月   2 19:16 mysys_ssl
drwxr-xr-x. 10 7161 31415    131 6月   2 19:16 packaging
drwxr-xr-x. 18 7161 31415   4096 6月   2 19:16 plugin
drwxr-xr-x.  4 7161 31415     36 6月   2 19:16 rapid
-rw-r--r--.  1 7161 31415    587 6月   2 19:05 README
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 regex
drwxr-xr-x.  4 7161 31415   4096 6月   2 19:16 scripts
drwxr-xr-x.  2 7161 31415      6 6月   2 19:15 source_downloads
drwxr-xr-x.  7 7161 31415  20480 6月   2 19:16 sql
drwxr-xr-x.  2 7161 31415    198 6月   2 19:16 sql-common
drwxr-xr-x. 13 7161 31415    175 6月   2 19:17 storage
drwxr-xr-x.  2 7161 31415   4096 6月   2 19:16 strings
drwxr-xr-x.  4 7161 31415    241 6月   2 19:16 support-files
drwxr-xr-x.  2 7161 31415     98 6月   2 19:16 testclients
drwxr-xr-x.  5 7161 31415     70 6月   2 19:16 unittest
-rw-r--r--.  1 7161 31415     88 6月   2 19:05 VERSION
drwxr-xr-x.  3 7161 31415   4096 6月   2 19:16 vio
drwxr-xr-x.  2 7161 31415     32 6月   2 19:16 win
drwxr-xr-x. 11 7161 31415   4096 6月   2 19:16 zlib

编译(失败,缺少openssl-devel)

[root@mysql001 mysql]# cmake -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=boost
-- Running cmake version 2.8.12.2
-- Could NOT find Git (missing:  GIT_EXECUTABLE)
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- CMAKE_GENERATOR: Unix Makefiles
-- Looking for SHM_HUGETLB
-- Looking for SHM_HUGETLB - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- SIZEOF_VOIDP 8
-- Performing Test HAVE_C_SHIFT_OR_OPTIMIZATION_BUG
-- Performing Test HAVE_C_SHIFT_OR_OPTIMIZATION_BUG - Failed
-- Performing Test HAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG
-- Performing Test HAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG - Failed
-- Performing Test HAVE_C_FLOATING_POINT_FUSED_MADD
-- Performing Test HAVE_C_FLOATING_POINT_FUSED_MADD - Failed
-- Performing Test HAVE_CXX_FLOATING_POINT_FUSED_MADD
-- Performing Test HAVE_CXX_FLOATING_POINT_FUSED_MADD - Failed
-- Performing Test HAVE_C_FP_CONTRACT_FLAG
-- Performing Test HAVE_C_FP_CONTRACT_FLAG - Success
-- Performing Test HAVE_CXX_FP_CONTRACT_FLAG
-- Performing Test HAVE_CXX_FP_CONTRACT_FLAG - Success
-- MySQL 5.7.31
-- Packaging as: mysql-5.7.31-Linux-x86_64
-- Local boost dir /usr/local/mysql/boost/boost_1_59_0
-- Found /usr/local/mysql/boost/boost_1_59_0/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 105900
-- BOOST_INCLUDE_DIR /usr/local/mysql/boost/boost_1_59_0
-- Performing Test HAVE_LLVM_LIBCPP
-- Performing Test HAVE_LLVM_LIBCPP - Failed
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for floor
-- Looking for floor - not found
-- Looking for floor in m
-- Looking for floor in m - found
-- Looking for gethostbyname_r
-- Looking for gethostbyname_r - found
-- Looking for bind
-- Looking for bind - found
-- Looking for crypt
-- Looking for crypt - not found
-- Looking for crypt in crypt
-- Looking for crypt in crypt - found
-- Looking for setsockopt
-- Looking for setsockopt - found
-- Looking for dlopen
-- Looking for dlopen - not found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for timer_create
-- Looking for timer_create - not found
-- Looking for timer_create in rt
-- Looking for timer_create in rt - found
-- Looking for atomic_thread_fence
-- Looking for atomic_thread_fence - not found
-- Looking for atomic_thread_fence in atomic
-- Looking for atomic_thread_fence in atomic - not found
-- Looking for backtrace
-- Looking for backtrace - found
-- Looking for include file alloca.h
-- Looking for include file alloca.h - found
-- Looking for include file arpa/inet.h
-- Looking for include file arpa/inet.h - found
-- Looking for include file crypt.h
-- Looking for include file crypt.h - found
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - found
-- Looking for include file execinfo.h
-- Looking for include file execinfo.h - found
-- Looking for include file fpu_control.h
-- Looking for include file fpu_control.h - found
-- Looking for include file grp.h
-- Looking for include file grp.h - found
-- Looking for include file ieeefp.h
-- Looking for include file ieeefp.h - not found
-- Looking for include file langinfo.h
-- Looking for include file langinfo.h - found
-- Looking for include file malloc.h
-- Looking for include file malloc.h - found
-- Looking for include file netinet/in.h
-- Looking for include file netinet/in.h - found
-- Looking for include file poll.h
-- Looking for include file poll.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - found
-- Looking for include file sys/mman.h
-- Looking for include file sys/mman.h - found
-- Looking for include file sys/resource.h
-- Looking for include file sys/resource.h - found
-- Looking for include file sys/select.h
-- Looking for include file sys/select.h - found
-- Looking for include file sys/socket.h
-- Looking for include file sys/socket.h - found
-- Looking for include files curses.h, term.h
-- Looking for include files curses.h, term.h - found
-- Looking for include file termios.h
-- Looking for include file termios.h - found
-- Looking for include file termio.h
-- Looking for include file termio.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file sys/wait.h
-- Looking for include file sys/wait.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file fnmatch.h
-- Looking for include file fnmatch.h - found
-- Looking for include file sys/un.h
-- Looking for include file sys/un.h - found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file sys/epoll.h
-- Looking for include file sys/epoll.h - found
-- Looking for TAILQ_FOREACH
-- Looking for TAILQ_FOREACH - found
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for backtrace
-- Looking for backtrace - found
-- Looking for printstack
-- Looking for printstack - not found
-- Looking for index
-- Looking for index - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for cuserid
-- Looking for cuserid - found
-- Looking for directio
-- Looking for directio - not found
-- Looking for ftruncate
-- Looking for ftruncate - found
-- Looking for compress
-- Looking for compress - not found
-- Looking for crypt
-- Looking for crypt - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for fchmod
-- Looking for fchmod - found
-- Looking for fcntl
-- Looking for fcntl - found
-- Looking for fdatasync
-- Looking for fdatasync - found
-- Looking for fdatasync
-- Looking for fdatasync - found
-- Looking for fedisableexcept
-- Looking for fedisableexcept - found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for gethostbyaddr_r
-- Looking for gethostbyaddr_r - found
-- Looking for gethrtime
-- Looking for gethrtime - not found
-- Looking for getnameinfo
-- Looking for getnameinfo - found
-- Looking for getpass
-- Looking for getpass - found
-- Looking for getpassphrase
-- Looking for getpassphrase - not found
-- Looking for getpwnam
-- Looking for getpwnam - found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for initgroups
-- Looking for initgroups - found
-- Looking for issetugid
-- Looking for issetugid - not found
-- Looking for getuid
-- Looking for getuid - found
-- Looking for geteuid
-- Looking for geteuid - found
-- Looking for getgid
-- Looking for getgid - found
-- Looking for getegid
-- Looking for getegid - found
-- Looking for lstat
-- Looking for lstat - found
-- Looking for madvise
-- Looking for madvise - found
-- Looking for malloc_info
-- Looking for malloc_info - found
-- Looking for memrchr
-- Looking for memrchr - found
-- Looking for mlock
-- Looking for mlock - found
-- Looking for mlockall
-- Looking for mlockall - found
-- Looking for mmap64
-- Looking for mmap64 - found
-- Looking for poll
-- Looking for poll - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for pread
-- Looking for pread - found
-- Looking for pthread_condattr_setclock
-- Looking for pthread_condattr_setclock - found
-- Looking for pthread_sigmask
-- Looking for pthread_sigmask - found
-- Looking for readlink
-- Looking for readlink - found
-- Looking for realpath
-- Looking for realpath - found
-- Looking for setfd
-- Looking for setfd - not found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for sleep
-- Looking for sleep - found
-- Looking for stpcpy
-- Looking for stpcpy - found
-- Looking for stpncpy
-- Looking for stpncpy - found
-- Looking for strlcpy
-- Looking for strlcpy - not found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for strlcat
-- Looking for strlcat - not found
-- Looking for strsignal
-- Looking for strsignal - found
-- Looking for fgetln
-- Looking for fgetln - not found
-- Looking for strsep
-- Looking for strsep - found
-- Looking for tell
-- Looking for tell - not found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for memalign
-- Looking for memalign - found
-- Looking for nl_langinfo
-- Looking for nl_langinfo - found
-- Looking for ntohll
-- Looking for ntohll - not found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for epoll_create
-- Looking for epoll_create - found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for kqueue
-- Looking for kqueue - not found
-- Looking for timeradd
-- Looking for timeradd - found
-- Looking for timerclear
-- Looking for timerclear - found
-- Looking for timercmp
-- Looking for timercmp - found
-- Looking for timerisset
-- Looking for timerisset - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sys/times.h
-- Looking for include file sys/times.h - found
-- Looking for times
-- Looking for times - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for lrand48
-- Looking for lrand48 - found
-- Looking for TIOCGWINSZ
-- Looking for TIOCGWINSZ - found
-- Looking for FIONREAD
-- Looking for FIONREAD - found
-- Looking for FIONREAD
-- Looking for FIONREAD - not found
-- Looking for SIGEV_THREAD_ID
-- Looking for SIGEV_THREAD_ID - found
-- Looking for SIGEV_PORT
-- Looking for SIGEV_PORT - not found
-- Looking for log2
-- Looking for log2 - found
-- Looking for isinf
-- Looking for isinf - found
-- Performing Test HAVE_CXX_ISINF
-- Performing Test HAVE_CXX_ISINF - Success
-- Looking for timer_create
-- Looking for timer_create - found
-- Looking for timer_settime
-- Looking for timer_settime - found
-- Looking for kqueue
-- Looking for kqueue - not found
-- Looking for EVFILT_TIMER
-- Looking for EVFILT_TIMER - not found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Check size of char *
-- Check size of char * - done
-- Check size of long
-- Check size of long - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long long
-- Check size of long long - done
-- Check size of off_t
-- Check size of off_t - done
-- Check size of time_t
-- Check size of time_t - done
-- Check size of struct timespec
-- Check size of struct timespec - done
-- Check size of uint
-- Check size of uint - done
-- Check size of ulong
-- Check size of ulong - done
-- Check size of u_int32_t
-- Check size of u_int32_t - done
-- Performing Test HAVE_VISIBILITY_HIDDEN
-- Performing Test HAVE_VISIBILITY_HIDDEN - Success
-- Checking stack direction : -1
-- Looking for include files time.h, sys/time.h
-- Looking for include files time.h, sys/time.h - found
-- Looking for O_NONBLOCK
-- Looking for O_NONBLOCK - found
-- Performing Test HAVE_PAUSE_INSTRUCTION
-- Performing Test HAVE_PAUSE_INSTRUCTION - Success
-- Performing Test HAVE_BUILTIN_UNREACHABLE
-- Performing Test HAVE_BUILTIN_UNREACHABLE - Success
-- Performing Test HAVE_BUILTIN_EXPECT
-- Performing Test HAVE_BUILTIN_EXPECT - Success
-- Performing Test HAVE_BUILTIN_STPCPY
-- Performing Test HAVE_BUILTIN_STPCPY - Success
-- Performing Test HAVE_GCC_ATOMIC_BUILTINS
-- Performing Test HAVE_GCC_ATOMIC_BUILTINS - Success
-- Performing Test HAVE_GCC_SYNC_BUILTINS
-- Performing Test HAVE_GCC_SYNC_BUILTINS - Success
-- Looking for netinet/in6.h
-- Looking for netinet/in6.h - not found
-- Check size of struct sockaddr_in6
-- Check size of struct sockaddr_in6 - done
-- Check size of struct in6_addr
-- Check size of struct in6_addr - done
-- Performing Test HAVE_SOCKADDR_STORAGE_SS_FAMILY
-- Performing Test HAVE_SOCKADDR_STORAGE_SS_FAMILY - Success
-- Performing Test HAVE_SOCKADDR_IN_SIN_LEN
-- Performing Test HAVE_SOCKADDR_IN_SIN_LEN - Failed
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_LEN
-- Performing Test HAVE_SOCKADDR_IN6_SIN6_LEN - Failed
-- Performing Test HAVE_PTHREAD_THREADID_NP
-- Performing Test HAVE_PTHREAD_THREADID_NP - Failed
-- Performing Test HAVE_IMPLICIT_DEPENDENT_NAME_TYPING
-- Performing Test HAVE_IMPLICIT_DEPENDENT_NAME_TYPING - Failed
-- Looking for chown
-- Looking for chown - found
-- Looking for include file numa.h
-- Looking for include file numa.h - not found
-- Looking for include file numaif.h
-- Looking for include file numaif.h - not found
-- NUMA library missing or required version not available
-- Check size of socklen_t
-- Check size of socklen_t - failed
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for unistd.h
-- Looking for unistd.h - found
-- OPENSSL_INCLUDE_DIR = OPENSSL_INCLUDE_DIR-NOTFOUND
-- OPENSSL_LIBRARY = OPENSSL_LIBRARY-NOTFOUND
-- CRYPTO_LIBRARY = CRYPTO_LIBRARY-NOTFOUND
-- OPENSSL_MAJOR_VERSION =
-- OPENSSL_MINOR_VERSION =
-- OPENSSL_FIX_VERSION =
-- Looking for SHA512_DIGEST_LENGTH
-- Looking for SHA512_DIGEST_LENGTH - not found
--
Cannot find appropriate system libraries for WITH_SSL=system.
Make sure you have specified a supported SSL version.
Valid options are :
system (use the OS openssl library),
yes (synonym for system),


CMake Error at cmake/ssl.cmake:63 (MESSAGE):
  Please install the appropriate openssl developer package.

Call Stack (most recent call first):
  cmake/ssl.cmake:280 (FATAL_SSL_NOT_FOUND_ERROR)
  CMakeLists.txt:580 (MYSQL_CHECK_SSL)


-- Configuring incomplete, errors occurred!
See also "/usr/local/mysql/CMakeFiles/CMakeOutput.log".
See also "/usr/local/mysql/CMakeFiles/CMakeError.log".

排错

通过“Please install the appropriate openssl developer package.”可以判断缺少openssl-devel包。

[root@mysql001 mysql]# openssl version
OpenSSL 1.0.2k-fips  26 Jan 2017
[root@mysql001 mysql]# rpm -qa | grep openssl
openssl-libs-1.0.2k-19.el7.x86_64
openssl-1.0.2k-19.el7.x86_64
[root@mysql001 mysql]# yum search openssl-devel
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.huaweicloud.com
 * updates: mirror.bit.edu.cn
============================================================================ N/S matched: openssl-dev ============================================================================
openssl-devel.i686 : Files for development of applications which will use OpenSSL
openssl-devel.x86_64 : Files for development of applications which will use OpenSSL
xmlsec1-openssl-devel.i686 : OpenSSL crypto plugin for XML Security Library
xmlsec1-openssl-devel.x86_64 : OpenSSL crypto plugin for XML Security Library

  名称和简介匹配 only,使用“search all”试试。


# 安装openssl-devel
  [root@mysql001 mysql]# yum install -y openssl-devel
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.huaweicloud.com
 * updates: mirror.bit.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 openssl-devel.x86_64.1.1.0.2k-19.el7 将被 安装
--> 正在处理依赖关系 zlib-devel(x86-64),它被软件包 1:openssl-devel-1.0.2k-19.el7.x86_64 需要
--> 正在处理依赖关系 krb5-devel(x86-64),它被软件包 1:openssl-devel-1.0.2k-19.el7.x86_64 需要
--> 正在检查事务
---> 软件包 krb5-devel.x86_64.0.1.15.1-46.el7 将被 安装
--> 正在处理依赖关系 libkadm5(x86-64) = 1.15.1-46.el7,它被软件包 krb5-devel-1.15.1-46.el7.x86_64 需要
--> 正在处理依赖关系 libverto-devel,它被软件包 krb5-devel-1.15.1-46.el7.x86_64 需要
--> 正在处理依赖关系 libselinux-devel,它被软件包 krb5-devel-1.15.1-46.el7.x86_64 需要
--> 正在处理依赖关系 libcom_err-devel,它被软件包 krb5-devel-1.15.1-46.el7.x86_64 需要
--> 正在处理依赖关系 keyutils-libs-devel,它被软件包 krb5-devel-1.15.1-46.el7.x86_64 需要
---> 软件包 zlib-devel.x86_64.0.1.2.7-18.el7 将被 安装
--> 正在检查事务
---> 软件包 keyutils-libs-devel.x86_64.0.1.5.8-3.el7 将被 安装
---> 软件包 libcom_err-devel.x86_64.0.1.42.9-17.el7 将被 安装
---> 软件包 libkadm5.x86_64.0.1.15.1-46.el7 将被 安装
---> 软件包 libselinux-devel.x86_64.0.2.5-15.el7 将被 安装
--> 正在处理依赖关系 libsepol-devel(x86-64) >= 2.5-10,它被软件包 libselinux-devel-2.5-15.el7.x86_64 需要
--> 正在处理依赖关系 pkgconfig(libsepol),它被软件包 libselinux-devel-2.5-15.el7.x86_64 需要
--> 正在处理依赖关系 pkgconfig(libpcre),它被软件包 libselinux-devel-2.5-15.el7.x86_64 需要
---> 软件包 libverto-devel.x86_64.0.0.2.5-4.el7 将被 安装
--> 正在检查事务
---> 软件包 libsepol-devel.x86_64.0.2.5-10.el7 将被 安装
---> 软件包 pcre-devel.x86_64.0.8.32-17.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==================================================================================================================================================================================
 Package                                           架构                                 版本                                             源                                  大小
==================================================================================================================================================================================
正在安装:
 openssl-devel                                     x86_64                               1:1.0.2k-19.el7                                  base                               1.5 M
为依赖而安装:
 keyutils-libs-devel                               x86_64                               1.5.8-3.el7                                      base                                37 k
 krb5-devel                                        x86_64                               1.15.1-46.el7                                    base                               272 k
 libcom_err-devel                                  x86_64                               1.42.9-17.el7                                    base                                32 k
 libkadm5                                          x86_64                               1.15.1-46.el7                                    base                               179 k
 libselinux-devel                                  x86_64                               2.5-15.el7                                       base                               187 k
 libsepol-devel                                    x86_64                               2.5-10.el7                                       base                                77 k
 libverto-devel                                    x86_64                               0.2.5-4.el7                                      base                                12 k
 pcre-devel                                        x86_64                               8.32-17.el7                                      base                               480 k
 zlib-devel                                        x86_64                               1.2.7-18.el7                                     base                                50 k

事务概要
==================================================================================================================================================================================
安装  1 软件包 (+9 依赖软件包)

总下载量:2.8 M
安装大小:6.0 M
Downloading packages:
(1/10): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm                                                                                                         |  37 kB  00:00:00
(2/10): libkadm5-1.15.1-46.el7.x86_64.rpm                                                                                                                  | 179 kB  00:00:00
(3/10): krb5-devel-1.15.1-46.el7.x86_64.rpm                                                                                                                | 272 kB  00:00:00
(4/10): libcom_err-devel-1.42.9-17.el7.x86_64.rpm                                                                                                          |  32 kB  00:00:00
(5/10): libsepol-devel-2.5-10.el7.x86_64.rpm                                                                                                               |  77 kB  00:00:00
(6/10): libselinux-devel-2.5-15.el7.x86_64.rpm                                                                                                             | 187 kB  00:00:00
(7/10): libverto-devel-0.2.5-4.el7.x86_64.rpm                                                                                                              |  12 kB  00:00:00
(8/10): zlib-devel-1.2.7-18.el7.x86_64.rpm                                                                                                                 |  50 kB  00:00:00
(9/10): pcre-devel-8.32-17.el7.x86_64.rpm                                                                                                                  | 480 kB  00:00:00
(10/10): openssl-devel-1.0.2k-19.el7.x86_64.rpm                                                                                                            | 1.5 MB  00:00:01
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                              1.6 MB/s | 2.8 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : libsepol-devel-2.5-10.el7.x86_64                                                                                                                             1/10
  正在安装    : libcom_err-devel-1.42.9-17.el7.x86_64                                                                                                                        2/10
  正在安装    : libkadm5-1.15.1-46.el7.x86_64                                                                                                                                3/10
  正在安装    : pcre-devel-8.32-17.el7.x86_64                                                                                                                                4/10
  正在安装    : libselinux-devel-2.5-15.el7.x86_64                                                                                                                           5/10
  正在安装    : zlib-devel-1.2.7-18.el7.x86_64                                                                                                                               6/10
  正在安装    : libverto-devel-0.2.5-4.el7.x86_64                                                                                                                            7/10
  正在安装    : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                                                                       8/10
  正在安装    : krb5-devel-1.15.1-46.el7.x86_64                                                                                                                              9/10
  正在安装    : 1:openssl-devel-1.0.2k-19.el7.x86_64                                                                                                                        10/10
  验证中      : krb5-devel-1.15.1-46.el7.x86_64                                                                                                                              1/10
  验证中      : libselinux-devel-2.5-15.el7.x86_64                                                                                                                           2/10
  验证中      : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                                                                       3/10
  验证中      : libverto-devel-0.2.5-4.el7.x86_64                                                                                                                            4/10
  验证中      : zlib-devel-1.2.7-18.el7.x86_64                                                                                                                               5/10
  验证中      : pcre-devel-8.32-17.el7.x86_64                                                                                                                                6/10
  验证中      : 1:openssl-devel-1.0.2k-19.el7.x86_64                                                                                                                         7/10
  验证中      : libkadm5-1.15.1-46.el7.x86_64                                                                                                                                8/10
  验证中      : libcom_err-devel-1.42.9-17.el7.x86_64                                                                                                                        9/10
  验证中      : libsepol-devel-2.5-10.el7.x86_64                                                                                                                            10/10

已安装:
  openssl-devel.x86_64 1:1.0.2k-19.el7

作为依赖被安装:
  keyutils-libs-devel.x86_64 0:1.5.8-3.el7        krb5-devel.x86_64 0:1.15.1-46.el7         libcom_err-devel.x86_64 0:1.42.9-17.el7        libkadm5.x86_64 0:1.15.1-46.el7
  libselinux-devel.x86_64 0:2.5-15.el7            libsepol-devel.x86_64 0:2.5-10.el7        libverto-devel.x86_64 0:0.2.5-4.el7            pcre-devel.x86_64 0:8.32-17.el7
  zlib-devel.x86_64 0:1.2.7-18.el7

完毕!

再次编译

[root@mysql001 mysql]# cmake -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=boost

省略......

成功编译

最后执行

make && make install

你可能感兴趣的:(MySQL)