- 论坛徽章:
- 3
|
8705:20160517:181535.420 [Z3001] connection to database 'zabbix' failed: [2003] Can't connect to MySQL server on 'host' (13)
8705:20160517:181535.420 database is down: reconnecting in 10 seconds
数据库和ZABBIX在同一台服务器上。
# cat /etc/hosts
127.0.0.1 host
192.168.8.120 host
# grep -v "#" /etc/zabbix/zabbix_server.conf|grep DB
DBHost=host
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
# cat /etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB;
$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'host';
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'Zabbix;
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';
$ZBX_SERVER = '192.168.8.120';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'host';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
手工连接没有问题。
# mysql -u zabbix -p'zabbix'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> |
|