Zabbix connection to MySQL error

zabbix

By trying to open Zabbix 2.2.2 server web-interface, I've got an error:

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

This is log:

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]

No messages about connection error. This is configuration file:

### 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

I can connect from shell with that username and password:

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)

Thank you for help!

Best Answer

You have pasted here server configuration file - frontend uses a different file. Please see the zabbix.conf.php file in the frontend directory and make sure password in there matches the password in the server configuration file.