Could not connect to sonar_db from localhost

Hello,

I just did a clean install of sonarqube “sonarqube-9.3.0.51899” on CentOS7.
After following all the installation steps, I cannot connect to the Web interface because the connection to the “sonar_db” database does not work.
=> psql -h localhost -p 5432 -d sonar_db -U sonar
Error:
psql: could not connect to server: Connection refused

  • Is the server active on host ‘localhost’ (::1) and does it accept TCP/IP connections on port 5432?*
    could not connect to server: Connection refused
  • Is the server active on host ‘localhost’ (127.0.0.1) and does it accept TCP/IP connections on port 5432?*

On the other hand, the connection with the IP address of the server works.
=> psql -h Server-IP-address -p 5432 -d sonar_db -U sonar

Could you help me to solve this problem?

Thanks,

I found the solution for my problem.
To authorize the internal connection, it is necessary to update the parameter concerned as below:
file: /var/lib/pgsql/11/data/postgresql.conf
==> listen_addresses = 'ip_server_address, localhost’
Thank you,

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.