LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-26-2018, 09:04 PM   #1
ultra99
Member
 
Registered: Aug 2004
Distribution: openSUSE Tumbleweed
Posts: 111

Rep: Reputation: 15
postgresql setup


I've installed Postgresql 10 and pgadmin 3 in opensuse. I've also already setup a user with Superuser credentials. Now, in pgadmin and New Server Registration, I get an error that connection timed out:

Name: localhost
Address: 168.0.0.1
Port: 5432
Maintenance DB: postgres
Username: whatever I created in command line
Password: whatever

I get this error:


Quote:
Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused Is the server running on host "168.0.0.1" and accepting TCP/IP connections on port 5432?
 
Old 11-27-2018, 12:44 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,566

Rep: Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794
Quote:
Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused Is the server running on host "168.0.0.1" and accepting TCP/IP connections on port 5432?
Most likely you mean 127.0.0.1 (localhost) instead of 168.0.0.1
Also make sure postgres is running and listening on the default port 5432

Regards
 
Old 11-27-2018, 04:53 AM   #3
ultra99
Member
 
Registered: Aug 2004
Distribution: openSUSE Tumbleweed
Posts: 111

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Most likely you mean 127.0.0.1 (localhost) instead of 168.0.0.1
Also make sure postgres is running and listening on the default port 5432

Regards
I doubled checked the password that I created in command to make sure it's right, but I'm getting the following error:

Quote:
Ident authentication failed
The server doesn't accept the current user: The server reports
FATAL: Ident authentication failed for user "ultra99"
If this message appears, the pg_hba.conf entry found for your client / user / database combination is set to "ident" authentication. Some distributions, e.g. Debian, have this by default. To perform ident based authentication successfully, you need additional setup; see the PostgreSQL help for this. For a beginner, it might be more appropriate to use a different authentication method; MD5 encrypted passwords are a good choice, which can be configured by an entry in pg_hba.conf like this:
host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to all users on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III to edit the pg_hba.conf configuration file. After changing pg_hba.conf, you need to trigger a server configuration reload using pg_ctl or by stopping and restarting the server process.
Code:
postgres=# \du
                                   List of roles
 Role name |                         Attributes                         | Member of 
-----------+------------------------------------------------------------+-----------
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 ultra99   | Superuser                                                  | {}
Status:

Code:
systemctl status postgresql
● postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disab>
   Active: active (running) since Sun 2018-11-25 09:23:45 EST; 1 day 20h ago
  Process: 1393 ExecStart=/usr/share/postgresql/postgresql-script start (code=exited, status>
 Main PID: 1475 (postgres)
    Tasks: 8 (limit: 4915)
   Memory: 39.4M
   CGroup: /system.slice/postgresql.service
           ├─1475 /usr/lib/postgresql10/bin/postgres -D /var/lib/pgsql/data
           ├─1526 postgres: logger process   
           ├─1546 postgres: checkpointer process   
           ├─1547 postgres: writer process   
           ├─1548 postgres: wal writer process   
           ├─1549 postgres: autovacuum launcher process   
           ├─1550 postgres: stats collector process   
           └─1551 postgres: bgworker: logical replication launcher   

Nov 25 09:23:44 linux-s6kv systemd[1]: Starting PostgreSQL database server...
Nov 25 09:23:44 linux-s6kv postgresql-script[1393]: 2018-11-25 09:23:44.778 EST   [1475]LOG:>
Nov 25 09:23:44 linux-s6kv postgresql-script[1393]: 2018-11-25 09:23:44.778 EST   [1475]LOG:>
Nov 25 09:23:44 linux-s6kv postgresql-script[1393]: 2018-11-25 09:23:44.785 EST   [1475]LOG:>
Nov 25 09:23:44 linux-s6kv postgresql-script[1393]: 2018-11-25 09:23:44.793 EST   [1475]LOG:>
Nov 25 09:23:44 linux-s6kv postgresql-script[1393]: 2018-11-25 09:23:44.812 EST   [1475]LOG:>
Nov 25 09:23:44 linux-s6kv postgresql-script[1393]: 2018-11-25 09:23:44.812 EST   [1475]HINT>
Nov 25 09:23:45 linux-s6kv systemd[1]: Started PostgreSQL database server.

Last edited by ultra99; 11-27-2018 at 04:54 AM.
 
Old 11-27-2018, 03:47 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,566

Rep: Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794Reputation: 1794
Quote:
I doubled checked the password that I created in command to make sure it's right, but I'm getting the following error:

Ident authentication failed
The server doesn't accept the current user: The server reports
FATAL: Ident authentication failed for user "ultra99"
If this message appears, the pg_hba.conf entry found for your client / user / database combination is set to "ident" authentication. Some distributions, e.g. Debian, have this by default. To perform ident based authentication successfully, you need additional setup; see the PostgreSQL help for this. For a beginner, it might be more appropriate to use a different authentication method; MD5 encrypted passwords are a good choice, which can be configured by an entry in pg_hba.conf like this:
host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to all users on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III to edit the pg_hba.conf configuration file. After changing pg_hba.conf, you need to trigger a server configuration reload using pg_ctl or by stopping and restarting the server process.
This is completely different from your OP. You mentioned you couldn't connect to the local postgres server.
Now your problem is with your user auth!

Anyway, did you follow the instructions to change ident with md5 in pg_hba.conf? Try the following and see if it helps:
Code:
local   all             all                                     md5
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

Last edited by bathory; 11-27-2018 at 03:50 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Difference Between PostgreSQL And MySQL And How To Migrate From MySQL To PostgreSQL LXer Syndicated Linux News 0 05-27-2017 08:26 PM
LXer: The PostgreSQL Global Development Group's PostgreSQL LXer Syndicated Linux News 0 03-31-2016 07:35 PM
PostgreSQL setup dt4stat Linux - Newbie 1 03-11-2005 03:10 PM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM
Totally lost - RH 7.1, apache, php4, postgreSQL setup marktaff Linux - Newbie 1 09-19-2001 03:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration