1. 程式人生 > 其它 >zabbix 原始碼編譯安裝找不到mysql_config

zabbix 原始碼編譯安裝找不到mysql_config

1.準備LNMP環境,

2.下載並解壓zabbix包:

下載地址 :https://sourceforge.net/p/zabbix/activity/?page=0&limit=100#5e836904f0d3473e24304e3d

解壓tar -zxvf zabbix-4.0.33.tar.gz

3.安裝依賴:yum install libxml2-devel net-snmp-devel libevent-devel curl-devel pcre*

4../configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-proxy --with-mysql=/usr/local/mysql/bin/mysql_config --enable-ipv6 --with-net-

出現報錯:

checking size of void *... 8
checking for mysql_config... /usr/local/mysql/bin/mysql_config
configure: error: MySQL library not found

5.出現問題是沒有找到mysql_config,查詢檔案證明確實沒有

[root@localhost zabbix-4.0.33]# find / -name "mysql_config*"
/usr/bin/mysql_config_editor
/usr/share/man/man1/mysql_config_editor.1.gz

6.mysql是rpm包裝的,通過命令查詢,發現沒有mysql_devel包,需要下載對應版本的:http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/

[root@localhost /]# rpm -aq | grep mysql
mysql-community-server-5.6.51-2.el7.x86_64
mysql-community-release-el7-5.noarch
mysql-community-common-5.6.51-2.el7.x86_64
mysql-community-libs-5.6.51-2.el7.x86_64
mysql-community-client-5.6.51-2.el7.x86_64

7.找到上面6中檔案的所在位置,上傳並解壓

[root@localhost doc]# rpm -ivh mysql-community-devel-5.6.51-2.el6.x86_64.rpm

8.重新執行配置原始碼命令,顯示如下則成功。

***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************