• Centos 7.5源码编译安装zabbix4.0报fatal error: mysql.h: No such file or directory


    系统环境:CentOS 7.5是最小化安装的

    编译信息

    编译选项:
    root@Server01 zabbix-4.0.0]# ./configure --prefix=/usr/share/applications/zabbix --enable-server --enable-agent --with-mysql=/usr/bin/mysql_config_editor --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2=/usr/lib64/libxml2.so
    编译结果:
    Configuration:
    
      Detected OS:           linux-gnu
      Install path:          /usr/share/applications/zabbix
      Compilation arch:      linux
    
      Compiler:              cc
      Compiler flags:         -g -O2 
    
      Library-specific flags:
        database:                  
        Net-SNMP:               -I/usr/local/include -I/usr/lib64/perl5/CORE -I. -I/usr/include
    
      Enable server:         yes
      Server details:
        With database:         MySQL
        WEB Monitoring:        cURL
          SSL certificates:      /usr/share/applications/zabbix/share/zabbix/ssl/certs
          SSL keys:              /usr/share/applications/zabbix/share/zabbix/ssl/keys
        Native Jabber:         no
        SNMP:                  yes
        IPMI:                  no
        SSH:                   no
        TLS:                   no
        ODBC:                  no
        Linker flags:                    -L/usr/lib64         -rdynamic   
        Libraries:                    -lxml2    -lnetsnmp   -lz -lpthread -levent    -lcurl -lm -ldl  -lresolv -lpcre 
        Configuration file:    /usr/share/applications/zabbix/etc/zabbix_server.conf
        External scripts:      /usr/share/applications/zabbix/share/zabbix/externalscripts
        Alert scripts:         /usr/share/applications/zabbix/share/zabbix/alertscripts
        Modules:               /usr/share/applications/zabbix/lib/modules
    
      Enable proxy:          no
    
      Enable agent:          yes
      Agent details:
        TLS:                   no
        Linker flags:                -rdynamic   
        Libraries:              -lz -lpthread    -lcurl -lm -ldl  -lresolv -lpcre 
        Configuration file:    /usr/share/applications/zabbix/etc/zabbix_agentd.conf
        Modules:               /usr/share/applications/zabbix/lib/modules
    
      Enable Java gateway:   no
    
      LDAP support:          no
      IPv6 support:          yes
    
    ***********************************************************
    *            Now run 'make install'                       *
    *                                                         *
    *            Thank you for using Zabbix!                  *
    *              <http://www.zabbix.com>                    *
    ***********************************************************

    make install 报错

    。。。。。。。。。。。。。。。
    Making install in zbxcommshigh
    make[3]: Entering directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh'
    make[4]: Entering directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh'
    make[4]: Nothing to be done for `install-exec-am'.
    make[4]: Nothing to be done for `install-data-am'.
    make[4]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh'
    make[3]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh'
    Making install in zbxdb
    make[3]: Entering directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxdb'
    cc -DHAVE_CONFIG_H -I. -I../../../include     -g -O2  -MT libzbxdb_a-db.o -MD -MP -MF .deps/libzbxdb_a-db.Tpo -c -o libzbxdb_a-db.o `test -f 'db.c' || echo './'`db.c
    db.c:27:20: fatal error: mysql.h: No such file or directory
     # include "mysql.h"
                        ^
    compilation terminated.
    make[3]: *** [libzbxdb_a-db.o] Error 1
    make[3]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxdb'
    make[2]: *** [install-recursive] Error 1
    make[2]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs'
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/usr/local/src/zabbix-4.0.0/src'
    make: *** [install-recursive] Error 1

    解决办法:(针对我的环境)

    [root@Server01 zabbix-4.0.0]# ./configure --prefix=/usr/share/applications/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
    [root@Server01 zabbix-4.0.0]# echo $?
    0
    [root@Server01 zabbix-4.0.0]# make install
    [root@Server01 zabbix-4.0.0]# echo $?
    0
  • 相关阅读:
    jquery 实例
    jQuery总结或者锋利的jQuery笔记一
    前端 ajax 改写登录界面
    使用mybatisgenerator 辅助工具逆向工程
    一个ssm综合小案例-商品订单管理-第二天
    一个ssm综合小案例-商品订单管理-第一天
    一个ssm综合小案例-商品订单管理----写在前面
    delphi Ribbon 111
    Delphi Excel导入 的通用程序
    1. 微信公众号申请
  • 原文地址:https://www.cnblogs.com/zd520pyx1314/p/9818651.html
Copyright © 2020-2023  润新知