×


Zabbix tries to connect to the wrong database - Fix it now

Is your Zabbix tries to connect to the wrong database?

This guide will help you.


Zabbix is a server/client network monitoring system with many features with Zabbix Server supporting MySQL.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to resolve Zabbix issues.


What to do when Zabbix tries to connect to the wrong database ?

Recently, one of our customers approached us saying that he has a Zabbix server installed on a CentOS 7 remote server, but can’t get it running.

Here is the error message that he can see in /var/log/zabbix/:

[Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

The customer has a database for Zabbix, but it is named zabbixdb, not Zabbix (as in the error message)

Now let's see how our Support Experts help our customers resolve this error.


We suggested restarting the service and check if it still tries to use the Zabbix database in the logs.

In case, if it still uses the Zabbix database then we suggested checking if there are any duplicate DBName entries in zabbix_server.conf

To do this, use the below command:

grep DBName /etc/zabbix/zabbix_server.conf

Removing the duplicate entries must resolve the error.

Also, we suggest to re-check the Zabbix configuration file present in /etc/zabbix/web/zabbix.conf.php.

The database credentials will be present at a lower level in the file. 

So make sure not to add them at the top as it can be overwritten in memory.

So, make sure to check those variables present at the lower level in the configuration file.


[Need urgent assistance in fixing Zabbix errors? – We're available 24*7. ]


Conclusion

This article covers how to fix Zabbix error, when Zabbix tries to connect to the wrong database.

Basically, when Zabbix tries to connect to the wrong database, we can simply resolve it by restarting the service.

Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual machines (VMs) and cloud services. Zabbix provides monitoring metrics, among others network utilization, CPU load and disk space consumption.


How do I fix Zabbix server is not running?

Zabbix server error due to problems with the firewall.

1. As a root user, we check and confirm whether the firewall is allowing connection to Zabbix Server port which is 10051. 

2. If not, then we add the following rule in the configuration file /etc/sysconfig/iptables. 

3. Finally, restart the service in order to fix the error.


How to turn off Zabbix server?

To Stop the Service:

1. Use PuTTY to log in as user robomanager to the server where Zabbix is installed.

2. Run the following command to switch to user root: su - root.

3. Run the following command to stop the Zabbix service: systemctl stop zabbix_server.service.


To monitor my zabbix port:

1. In order to test your configuration, access the Monitoring menu and click on the Latest data option. 

2. Use the filter configuration to select the desired hostname. 

3. Click on the Apply button. 

4. You should be able to see the results of your TCP port monitoring using Zabbix.


Where is zabbix config located?

The Zabbix installation process created an Apache configuration file that contains these settings. 

It is located in the directory /etc/zabbix and is loaded automatically by Apache.


How does Zabbix proxy work?

Zabbix proxy is a process that may collect monitoring data from one or more monitored devices and send the information to the Zabbix server, essentially working on behalf of the server. 

All collected data is buffered locally and then transferred to the Zabbix server the proxy belongs to.


Zabbix Server supported DATABASE ENGINE:

Zabbix Server and Proxy support five database engines:

1. IBM DB2

2. MySQL

3. Oracle

4. PostgreSQL

5. SQLite