Sample Header Ad - 728x90

PostgreSQL, what is the hostname address of my default database?

10 votes
2 answers
119259 views
I just created a PostgreSQL database on my laptop (following these instructions ), which is running Linux CentOS 7. Now I would like to understand what is the hostname address of my default database. I thought it was localhost but it's not. I want to get to know the name or the IP address to use with the psql -h command. Basically, running this psql -h HOSTNAME command should let me have the same result of the psql command alone, that is letting me connect to my database. What is the **hostname address** of my default database? > > service postgresql status states: > ● postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2017-03-30 14:40:30 EDT; 1 day 1h ago Main PID: 2256 (postgres while both psql -h 127.0.0.1 and psql -h 127.0.0.1 -U davide produce this message: > psql: FATAL: Ident authentication failed for user "davide"`
Asked by DavideChicco.it (327 rep)
Mar 31, 2017, 05:51 PM
Last activity: Aug 18, 2020, 08:41 PM