zabbix server在web设置时连接不上mysql

Locky_LLL 2017-11-18 10:21:08
在centos6下安装zabbix3.4.4 mysql5.7.20 apache2 php-7.1.11

zabbix configure信息

./configure --prefix=/usr/local/zabbix --sysconfdir=/etc/zabbix/ --enable-server --enable-agent --with-net-snmp --with-libcurl --with-mysql --with-libxml2


vim /etc/zabbix/zabbix_server.conf
DBHost=localhost 数据库ip地址
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
ListenIP=127.0.0.1,192.168.10.10 zabbix server ip地址

iptables -I INPUT -p tcp -m multiport --dports 10050:10051 -j ACCEPT
service iptables save &&service iptables restart
ln -s /usr/local/zabbix/sbin/* /usr/sbin/
cp /home/sources/zabbix-3.0.3/misc/init.d/fedora/core/zabbix_* /etc/init.d/
chmod +x /etc/init.d/zabbix_*
sed -i "s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g" /etc/init.d/zabbix_server

配置WEB
vim /etc/httpd/conf/httpd.conf
ServerName 127.0.0.1
ServerName 192.168.10.10
DocumentRoot "/var/www/html"

mkdir -p /var/www/html/zabbix
cp -r /home/sources/zabbix-3.0.3/frontends/php/* /var/www/html/zabbix/
chown -R apache.apache /var/www/html/zabbix/
chkconfig zabbix_server on
/etc/init.d/zabbix_server start
service httpd restart


所有配置根据上面的一步一步配置的.

mysql 建立的zabbix也有所有权限:GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';


但是在web上面

就出现了这个样子,查看zabbix_server.log

5681:20171118:214444.291 using configuration file: /etc/zabbix/zabbix_server.conf
5681:20171118:214444.302 current database version (mandatory/optional): 03040000/03040005
5681:20171118:214444.302 required mandatory version: 03040000
5681:20171118:214444.312 server #0 started [main process]
5683:20171118:214444.313 server #1 started [configuration syncer #1]
5684:20171118:214444.313 server #2 started [alerter #1]
5685:20171118:214444.314 server #3 started [alerter #2]
5689:20171118:214444.314 server #7 started [http poller #1]
5690:20171118:214444.314 server #8 started [discoverer #1]
5692:20171118:214444.317 server #10 started [history syncer #2]
5688:20171118:214444.318 server #6 started [timer #1]
5691:20171118:214444.318 server #9 started [history syncer #1]
5693:20171118:214444.318 server #11 started [history syncer #3]
5687:20171118:214444.319 server #5 started [housekeeper #1]
5686:20171118:214444.319 server #4 started [alerter #3]
5694:20171118:214444.322 server #12 started [history syncer #4]
5696:20171118:214444.322 server #14 started [proxy poller #1]
5698:20171118:214444.322 server #16 started [task manager #1]
5700:20171118:214444.322 server #18 started [poller #2]
5702:20171118:214444.323 server #20 started [poller #4]
5695:20171118:214444.323 server #13 started [escalator #1]
5697:20171118:214444.323 server #15 started [self-monitoring #1]
5706:20171118:214444.323 server #24 started [trapper #2]
5699:20171118:214444.323 server #17 started [poller #1]
5701:20171118:214444.325 server #19 started [poller #3]
5703:20171118:214444.328 server #21 started [poller #5]
5704:20171118:214444.331 server #22 started [unreachable poller #1]
5705:20171118:214444.333 server #23 started [trapper #1]
5711:20171118:214444.333 server #29 started [alert manager #1]
5709:20171118:214444.339 server #27 started [trapper #5]
5712:20171118:214444.345 server #30 started [preprocessing manager #1]
5710:20171118:214444.345 server #28 started [icmp pinger #1]
5708:20171118:214444.352 server #26 started [trapper #4]
5707:20171118:214444.353 server #25 started [trapper #3]
5715:20171118:214445.123 server #33 started [preprocessing worker #3]
5714:20171118:214445.123 server #32 started [preprocessing worker #2]
5713:20171118:214445.123 server #31 started [preprocessing worker #1]
5687:20171118:221444.519 executing housekeeper
5687:20171118:221444.524 housekeeper [deleted 0 hist/trends, 0 items/triggers, 0 events, 0 problems, 0 sessions, 0 alarms, 0 audit items in 0.004447 sec, idle for 1 hour(s)]
也没有报什么错误.

在昨天报过:25841:20171117:155434.767 cannot use database "zabbix": Zabbix server cannot work with a Zabbix proxy database
错误,不会解决 就今天把zabbix makeclean 重新装了一遍,现在还是连接不上数据库.


求大神说说这是什么原因.
...全文
2569 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_36173111 2018-11-09
  • 打赏
  • 举报
回复
兄弟 我都问题解决了。你这样试试。 vi /../zabbix_server.conf 如果 DBHost ListenIp 都配置了的情况下 ,请将 DBhost 注解掉,保留listenIp即可 。web界面就可以连接到mysql了。
qq_36173111 2018-11-09
  • 打赏
  • 举报
回复
兄弟 你的问题解决了吗?我今天也出现了你描述的情况!zabbix_server.log日志没有错误,但是web却连接不上mysql.
Locky_LLL 2018-11-09
  • 打赏
  • 举报
回复
引用 3 楼 qq_36173111 的回复:
兄弟 我都问题解决了。你这样试试。

vi /../zabbix_server.conf

如果 DBHost ListenIp 都配置了的情况下 ,请将 DBhost 注解掉,保留listenIp即可 。web界面就可以连接到mysql了。


我的解决的,是因为mysql5.0版本以上的问题.解决方法可以看看我写的 zabbix安装,在后面我也写上了完整原因. 谢谢你专门回来给我发了下你的方法.
Locky_LLL 2017-11-20
  • 打赏
  • 举报
回复
有大神吗>?

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧