• mysql8 源码安装的坑-放弃了


    参考文档:以下文档提出了需要一些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 

    1. [root@redhat762100 mysql-8.0.34]# cmake \
    2. > -DCMAKE_INSTALL_PREFIX=/mysql/my3309 \
    3. > -DINSTALL_DATADIR=/mysql/my3309/data \
    4. > -DMYSQL_UNIX_ADDR=/mysql/my3309/run/mysql.sock \
    5. > -DMYSQL_TCP_PORT=3309
    6. -- Running cmake version 2.8.12.2
    7. CMake Warning at CMakeLists.txt:82 (MESSAGE):
    8. Please use cmake3 rather than cmake on this platform
    9. -- Please install cmake3 (yum install cmake3)
    10. CMake Error at CMakeLists.txt:112 (CMAKE_MINIMUM_REQUIRED):
    11. CMake 3.5.1 or higher is required. You are running version 2.8.12.2 <<<<<<< 这里
    12. -- Configuring incomplete, errors occurred!
    13. [root@redhat762100 mysql-8.0.34]#

    3 提示找不到openssl ,需要下载安装openssl 

    1. -- 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)
    2. CMake Error at Utilities/cmcurl/CMakeLists.txt:587 (message):
    3. Could not find OpenSSL. Install an OpenSSL development package or
    4. configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
    5. -- Configuring incomplete, errors occurred!
    6. ---------------------------------------------
    7. Error when bootstrapping CMake:
    8. Problem while running initial CMake
    9. ---------------------------------------------
    10. [root@redhat762100 cmake-3.27.7]#

    4  继续安装 ,提示需要这些包   yum install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils

    1. CMake Warning:
    2. No source or binary directory provided. Both will be assumed to be the
    3. same as the current working directory, but note that this warning will
    4. become a fatal error in future CMake releases.
    5. -- Running cmake version 3.27.7
    6. -- Could NOT find Git (missing: GIT_EXECUTABLE)
    7. -- This is .el7. as found from 'rpm -qf /'
    8. -- Looking for a devtoolset compiler
    9. CMake Warning at CMakeLists.txt:394 (MESSAGE):
    10. Could not find devtoolset compiler/linker in /opt/rh/devtoolset-11
    11. CMake Warning at CMakeLists.txt:396 (MESSAGE):
    12. You need to install the required packages:
    13. yum install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils
    14. CMake Error at CMakeLists.txt:398 (MESSAGE):
    15. Or you can set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER explicitly.
    16. -- Configuring incomplete, errors occurred!
    17. [root@redhat762100 mysql-8.0.34]#

    5 之前编译安装cmake的时候,没有./bootstrap,重新编译安装cmake 。而不是直接./configure   ,make  make install .
    ./bootstrap --prefix=/home/mysql/cmake/cmake   

    6 发现错误是gcc版本问题 ,需要gcc7.1 

    1. CMake Warning:
    2. No source or binary directory provided. Both will be assumed to be the
    3. same as the current working directory, but note that this warning will
    4. become a fatal error in future CMake releases.
    5. -- Running cmake version 3.27.7
    6. -- Could NOT find Git (missing: GIT_EXECUTABLE)
    7. -- CMAKE_MODULE_PATH is /home/mysql/mysql-8.0.34/cmake
    8. -- MySQL 8.0.34
    9. -- Source directory /home/mysql/mysql-8.0.34
    10. -- Binary directory /home/mysql/mysql-8.0.34
    11. CMake Warning at CMakeLists.txt:602 (MESSAGE):
    12. This is an in-source build
    13. -- CMAKE_GENERATOR: Unix Makefiles
    14. CMake Error at cmake/os/Linux.cmake:71 (MESSAGE):
    15. GCC 7.1 or newer is required
    16. Call Stack (most recent call first):
    17. CMakeLists.txt:709 (INCLUDE)
    18. -- Configuring incomplete, errors occurred!
    19. [root@redhat762100 mysql-8.0.34]#

    7 安装gcc,编译需要好几个小时,而且占用空间很大。磁盘空间撑爆了,放弃。

    查看redhat8上,gcc是8.5 .但仍需要很多包,放弃编译安装了。

    1. [root@pg154 ~]# gcc --version
    2. gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)
    3. Copyright (C) 2018 Free Software Foundation, Inc.
    4. This is free software; see the source for copying conditions. There is NO
    5. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    6. [root@pg154 ~]#

    END 

  • 相关阅读:
    Vue+Node的校内闲置物品回收管理系统毕业设计-附源码140933
    高精度室内定位技术,在智慧工厂安全管理的应用
    熬夜肝出囊括Java后端95%的面试题解析,备战秋招,助你赢在起跑线
    LeetCode-496-下一个更大元素
    一种新型侧信道攻击方法,影响大部分苹果 A&M 系列芯片
    jenkins
    有氧运动与无氧运动的区别
    SwiftUI 导航设置
    vue+element封装一个填写和校验ip地址的组件
    几种开源协议的区别(Apache、MIT、BSD、MPL、GPL、LGPL)
  • 原文地址:https://blog.csdn.net/xxzhaobb/article/details/133673894