Ad Widget

Collapse

RHEL/CentOS/OL 8.1/8.2 未能使用 MySQL 8.0.19 编译的问题

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ox_one
    Junior Member
    • Mar 2019
    • 1

    #1

    RHEL/CentOS/OL 8.1/8.2 未能使用 MySQL 8.0.19 编译的问题

    ./configure --prefix=/usr/local/zabbix --with-openssl=/usr/local/openssl --with-libcurl=/usr/local/curl/bin/curl-config --with-libpcre=/usr/local/pcre --with-ssh2=/usr/local/libssh2 --with-zlib=/usr/local/zlib --with-libevent=/usr/local/libevent --with-libxml2 --with-iconv-include --enable-ipv6 --enable-server --with-mysql=/usr/local/mysql/bin/mysql_config

    报错如下:
    checking for long long format... no
    checking for -rdynamic linking option... yes
    checking for libperfstat 5.2.0.40 fileset... no
    checking for libperfstat 5.3.0.60 fileset... no
    checking for architecture... linux (linux-gnu)
    checking for the linux kernel version... unknown family (4.18.0-167.el8.x86_64)
    checking size of void *... 8
    checking for mysql_config... /usr/local/mysql/bin/mysql_config
    checking for main in -lmysqlclient... no
    configure: error: Not found mysqlclient library
    编译配置失败


    确定 LD_RARYLIB_PATH 设置无误 ……

    经测试 RHEL 8.0/8.1/8.2 + mysql 5.7.29 + zabbix 4.4.6 没问题

    经测试 RHEL 8.0/8.1/8.2 + mysql 8.0.19 + zabbix 4.4.6 上没法检测到 mysqlclient library 从而导致编译失败

    [root@dev scripts]# /usr/local/mysql/bin/mysql_config
    Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
    Compiler: GNU 8.3.1
    Options:
    --cflags [-I/usr/local/mysql/include ]
    --cxxflags [-I/usr/local/mysql/include ]
    --include [-I/usr/local/mysql/include]
    --libs [-L/usr/local/mysql/lib -Wl,-R,/usr/local/mysql/lib -Wl,-rpath-link=/usr/local/mysql/lib/private -lmysqlclient -lpthread -lm -lrt -lssl -lcrypto -ldl]
    --libs_r [-L/usr/local/mysql/lib -Wl,-R,/usr/local/mysql/lib -Wl,-rpath-link=/usr/local/mysql/lib/private -lmysqlclient -lpthread -lm -lrt -lssl -lcrypto -ldl]
    --plugindir [/usr/local/mysql/lib/plugin]
    --socket [/tmp/mysql.sock]
    --port [0]
    --version [8.0.19]
    --variable=VAR VAR is one of:
    pkgincludedir [/usr/local/mysql/include]
    pkglibdir [/usr/local/mysql/lib]
    plugindir [/usr/local/mysql/lib/plugin]


    折腾了不少时间 依旧无解 请各位大神支招 谢谢 ……
    Last edited by ox_one; 12-03-2020, 14:27.
  • svip
    Junior Member
    • Mar 2020
    • 1

    #2
    EL8安装zbx时 一律需要安装 openssl-devel:
    dnf install -y openssl-devel

    产生原因:
    某些情况下zbx不能正常识别gcc的参数: -Wl,-R 和 -Wl,-rpath-link 导致 一般安装 openssl-devel 可以解决 但是偶尔依旧会出现此异常 此时可尝试后续解决办法

    具体操作:
    目标文件(二进制解压版):/usr/local/mysql/bin/mysql_config

    查找行:
    libs="-L$pkglibdir -Wl,-R,$pkglibdir -Wl,-rpath-link=$pkglibdir/private"
    修改为:
    libs="-L$pkglibdir"
    Last edited by svip; 15-03-2020, 10:17.

    Comment

    • stevemars680
      Junior Member
      • Aug 2020
      • 1

      #3
      Originally posted by svip
      EL8安装zbx时 一律需要安装 openssl-devel:
      dnf install -y openssl-devel

      产生原因:
      某些情况下zbx不能正常识别gcc的参数: -Wl,-R 和 -Wl,-rpath-link 导致 一般安装 openssl-devel 可以解决 但是偶尔依旧会出现此异常 此时可尝试后续解决办法

      具体操作:
      目标文件(二进制解压版):/usr/local/mysql/bin/mysql_config

      查找行:
      libs="-L$pkglibdir -Wl,-R,$pkglibdir -Wl,-rpath-link=$pkglibdir/private here"
      修改为:
      libs="-L$pkglibdir"
      I tried this because i was facing the same issue. This is not a proper solution for mySql.

      Comment

      Working...