Назад | Перейти на главную страницу

Ошибка подключения Zabbix к MySQL

При попытке открыть веб-интерфейс сервера Zabbix 2.2.2 я получил ошибку:

Database error: Error connecting to database [Access denied for user 'zabbix'@'localhost' (using password: YES)]

Это журнал:

870:20140716:181121.327 Starting Zabbix Server. Zabbix 2.2.2 (revision 42525).
   870:20140716:181121.327 ****** Enabled features ******
   870:20140716:181121.328 SNMP monitoring:           YES
   870:20140716:181121.328 IPMI monitoring:            NO
   870:20140716:181121.328 WEB monitoring:            YES
   870:20140716:181121.329 VMware monitoring:          NO
   870:20140716:181121.329 Jabber notifications:      YES
   870:20140716:181121.329 Ez Texting notifications:  YES
   870:20140716:181121.329 ODBC:                       NO
   870:20140716:181121.329 SSH2 support:               NO
   870:20140716:181121.330 IPv6 support:              YES
   870:20140716:181121.330 ******************************
   870:20140716:181121.330 using configuration file: /usr/local/etc/zabbix22/zabbix_server.conf
   870:20140716:181121.335 current database version (mandatory/optional): 02020000/02020000
   870:20140716:181121.335 required mandatory version: 02020000
   871:20140716:181121.345 server #1 started [configuration syncer #1]
   872:20140716:181121.346 server #2 started [db watchdog #1]
   870:20140716:181121.395 server #0 started [main process]
   873:20140716:181121.424 server #3 started [poller #1]
   874:20140716:181121.452 server #4 started [poller #2]
   875:20140716:181121.479 server #5 started [poller #3]
   876:20140716:181121.509 server #6 started [poller #4]
   877:20140716:181121.535 server #7 started [poller #5]
   878:20140716:181121.564 server #8 started [unreachable poller #1]

Нет сообщений об ошибке подключения. Это файл конфигурации:

### Option: DBHost
#       Database host name.
#       If set to localhost, socket is used for MySQL.
#       If set to empty string, socket is used for PostgreSQL.
#
# Mandatory: no
# Default:
DBHost=localhost

### Option: DBName
#       Database name.
#       For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
#
# Mandatory: yes
# Default:
# DBName=

DBName=zabbix
### Option: DBSchema
#       Schema name. Used for IBM DB2.
#
# Mandatory: no
# Default:
# DBSchema=

### Option: DBUser
#       Database user. Ignored for SQLite.
#
# Mandatory: no
# Default:
# DBUser=

DBUser=zabbix

### Option: DBPassword
#       Database password. Ignored for SQLite.
#       Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=zabbix

### Option: DBSocket
#       Path to MySQL socket.
#
# Mandatory: no
# Default:
#DBSocket=/tmp/mysql.sock
### Option: DBPort
#       Database port when not using local socket. Ignored for SQLite.
#
# Mandatory: no
# Range: 1024-65535
# Default (for MySQL):
# DBPort=3306

Я могу подключиться из оболочки с этим именем пользователя и паролем:

root@zabbix-srv:/usr/home/ishayahu # mysql -u zabbix -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 167
Server version: 5.5.37 Source distribution

Copyright (c) 2000, 2014, 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> show grants for 'zabbix'@'localhost';
+------------------------------------------------------------------------------------------------------------------------+
| Grants for zabbix@localhost                                                                                            |
+------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY PASSWORD '*DEEF4D7D88CD046ECA02A80393B7780A63E7E789' |
| GRANT ALL PRIVILEGES ON `zabbix`.* TO 'zabbix'@'localhost'                                                             |
+------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Спасибо за помощь!

Вы вставили сюда файл конфигурации сервера - веб-интерфейс использует другой файл. Пожалуйста, просмотрите файл zabbix.conf.php в каталоге внешнего интерфейса и убедитесь, что пароль в нем совпадает с паролем в файле конфигурации сервера.