参考文档:以下文档提出了需要一些gcc,cmake等版本的需求
https://mysql.net.cn/doc/refman/8.0/en/source-installation-prerequisites.html
-- 错误
1
CMake Error: The source directory "/home/mysql/mysql-8.0.34-linux-glibc2.17-x86_64" does not appear to contain CMakeLists.txt.
CMake Error: The source directory does not appear to contain CMakeLists.txt.
下载了错误的包 mysql-8.0.34-linux-glibc2.17-x86_64.tar.gz
这种包 ,时已经编译好的,直接mysqld --initialize 就行了。 不用再次编译
实际应该下载的包
mysql-8.0.34.tar.gz
2 需要cmaker 3
- [root@redhat762100 mysql-8.0.34]# cmake \
- > -DCMAKE_INSTALL_PREFIX=/mysql/my3309 \
- > -DINSTALL_DATADIR=/mysql/my3309/data \
- > -DMYSQL_UNIX_ADDR=/mysql/my3309/run/mysql.sock \
- > -DMYSQL_TCP_PORT=3309
- -- Running cmake version 2.8.12.2
- CMake Warning at CMakeLists.txt:82 (MESSAGE):
- Please use cmake3 rather than cmake on this platform
-
-
- -- Please install cmake3 (yum install cmake3)
- CMake Error at CMakeLists.txt:112 (CMAKE_MINIMUM_REQUIRED):
- CMake 3.5.1 or higher is required. You are running version 2.8.12.2 <<<<<<< 这里
-
-
- -- Configuring incomplete, errors occurred!
- [root@redhat762100 mysql-8.0.34]#
3 提示找不到openssl ,需要下载安装openssl
- -- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
- CMake Error at Utilities/cmcurl/CMakeLists.txt:587 (message):
- Could not find OpenSSL. Install an OpenSSL development package or
- configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
-
-
- -- Configuring incomplete, errors occurred!
- ---------------------------------------------
- Error when bootstrapping CMake:
- Problem while running initial CMake
- ---------------------------------------------
- [root@redhat762100 cmake-3.27.7]#
4 继续安装 ,提示需要这些包 yum install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils
- CMake Warning:
- No source or binary directory provided. Both will be assumed to be the
- same as the current working directory, but note that this warning will
- become a fatal error in future CMake releases.
-
-
- -- Running cmake version 3.27.7
- -- Could NOT find Git (missing: GIT_EXECUTABLE)
- -- This is .el7. as found from 'rpm -qf /'
- -- Looking for a devtoolset compiler
- CMake Warning at CMakeLists.txt:394 (MESSAGE):
- Could not find devtoolset compiler/linker in /opt/rh/devtoolset-11
-
-
- CMake Warning at CMakeLists.txt:396 (MESSAGE):
- You need to install the required packages:
-
- yum install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils
-
-
-
- CMake Error at CMakeLists.txt:398 (MESSAGE):
- Or you can set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER explicitly.
-
-
- -- Configuring incomplete, errors occurred!
- [root@redhat762100 mysql-8.0.34]#
5 之前编译安装cmake的时候,没有./bootstrap,重新编译安装cmake 。而不是直接./configure ,make make install .
./bootstrap --prefix=/home/mysql/cmake/cmake
6 发现错误是gcc版本问题 ,需要gcc7.1
- CMake Warning:
- No source or binary directory provided. Both will be assumed to be the
- same as the current working directory, but note that this warning will
- become a fatal error in future CMake releases.
-
-
- -- Running cmake version 3.27.7
- -- Could NOT find Git (missing: GIT_EXECUTABLE)
- -- CMAKE_MODULE_PATH is /home/mysql/mysql-8.0.34/cmake
- -- MySQL 8.0.34
- -- Source directory /home/mysql/mysql-8.0.34
- -- Binary directory /home/mysql/mysql-8.0.34
- CMake Warning at CMakeLists.txt:602 (MESSAGE):
- This is an in-source build
-
-
- -- CMAKE_GENERATOR: Unix Makefiles
- CMake Error at cmake/os/Linux.cmake:71 (MESSAGE):
- GCC 7.1 or newer is required
- Call Stack (most recent call first):
- CMakeLists.txt:709 (INCLUDE)
-
-
- -- Configuring incomplete, errors occurred!
- [root@redhat762100 mysql-8.0.34]#
7 安装gcc,编译需要好几个小时,而且占用空间很大。磁盘空间撑爆了,放弃。
查看redhat8上,gcc是8.5 .但仍需要很多包,放弃编译安装了。
- [root@pg154 ~]# gcc --version
- gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)
- Copyright (C) 2018 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- [root@pg154 ~]#
END