zabbix 疑难杂症

  • Post author:
  • Post category:其他


zabbix-server 总是报错,

Zabbix database is not available.
<html><pre>MySQL database &quot;zabbix&quot; on &
quot;localhost&quot; is not available: Can&
apos;t connect to local MySQL server through socket &
 apos;/var/run/mysqld/mysqld.sock&apos; (2)</pre></html>

经过检查 mysql在远端都可以正常连接,而且zabbix服务本身也可以查看到历史数据,代表数据库连接没问题。至于提示的mysqld.sock 也做了映射

排查问题过程

1.前端部分,修改主机连接名由 localhost 为 本机127.0.0.1回环地址

vim /usr/share/zabbix/conf/zabbix.conf.php

vim /etc/zabbix/web/zabbix.conf.php

<?php
// Zabbix GUI configuration file.

$DB['TYPE']                             = 'MYSQL';
$DB['SERVER']                   = '127.0.0.1';
$DB['PORT']                             = '0';
$DB['DATABASE']                 = 'zabbix';
$DB['USER']                             = 'zabbix';
$DB['PASSWORD']                 = '123456';

vim /etc/zabbix/zabbix_server.conf

DBHost=127.0.0.1

先这样吧,不着调还会不会继续弹出问题框。



版权声明:本文为weixin_38627000原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。