0

I have installed Zabbix on a CentOS 7 remote server, but I can't get it running.

I took a look at /var/log/zabbix/ and I get the following error:

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

Now, the problem is that I DO have a database for zabbix, but it is named zabbixdb, not zabbix (as in the error message)

I tried to re-run the setup page and entered zabbixdb, but still nothing. Also, the /etc/zabbix/web/zabbix.conf.php is correctly configured

global $DB; $DB['TYPE'] = 'MYSQL'; $DB['SERVER'] = '127.0.0.1'; $DB['PORT'] = '0'; $DB['DATABASE'] = 'zabbixdb'; $DB['USER'] = 'zabbixuser'; $DB['PASSWORD'] = '[my_pass_here]'; // Schema name. Used for IBM DB2 and PostgreSQL. $DB['SCHEMA'] = ''; $ZBX_SERVER = '127.0.0.1'; $ZBX_SERVER_PORT = '10051'; $ZBX_SERVER_NAME = 'SV Zabbix Server'; $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG; 

I doubled checked and zabbixdb DOES exist and user zabbixuser has all the privileges over it.

GRANT ALL PRIVILEGES ON `zabbixdb`.* TO 'zabbixuser'@'localhost' 

What others reasons could be? Somehow zabbix has access, because it has created tables in the zabbixdb, but can't use them.


EDIT: The Solution

As it turns out, I followed the tutorial's instructions blindly. Thank you @Zatarra for the solution.

My problem was that when I wrote the DB's credentials, I wrote them exactly at the top of the file, while they where also present at a lower level, and thus, when read, were overwritten in memory.

I solved this by modifying the variables present at the lower level in the file.

1 Answer 1

2

Try to restart the service and check if it still tries to use the zabbix database in the logs. If it does check if you have duplicate DBName entries in zabbix_server.conf

grep DBName /etc/zabbix/zabbix_server.conf 

And are you getting the error for zabbix web or for zabbix server? As far as I see you are pasting the web configuration, maybe you are looking in the wrong place.

4
  • What would be the exact difference between web and server? Commented Jan 18, 2019 at 13:00
  • The web zabbix refers to the website where you have the dashboard while the server refers to zabbix server. Commented Jan 18, 2019 at 13:01
  • Understood, thank you. I will be checking in a few minutes and come back with updates Commented Jan 18, 2019 at 13:05
  • I did find something, and I'm working on it right now. The tutorial that I'd followed told be to add DBName, DBUsername etc in the file, but I added them at the top. As I have discovered now, they are also present somewhere else in the file, at a lower level. I'm editing the file as I speak. Will update soon the status Commented Jan 18, 2019 at 13:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.