Results 1 to 3 of 3

Thread: Postgres 9.3.5 on openSUSE 13.2 - login to DB not possible anymore

  1. #1
    Join Date
    Jun 2008
    Location
    Düsseldorf/Germany
    Posts
    244

    Default Postgres 9.3.5 on openSUSE 13.2 - login to DB not possible anymore

    Hi
    I installed postgres on openSUSE 13.2 and used it as before, but cant log in anymore.
    Was there a mayor change towards 13.1?
    Postgres Server starts:
    Code:
    linux-w869:/home/test # systemctl status postgresql
    postgresql.service - LSB: Start the PostgreSQL master daemon
       Loaded: loaded (/etc/init.d/postgresql)
       Active: active (exited) since Fr 2014-11-14 17:29:53 CET; 2s ago
      Process: 3224 ExecStop=/etc/init.d/postgresql stop (code=exited, status=0/SUCCESS)
      Process: 3297 ExecStart=/etc/init.d/postgresql start (code=exited, status=0/SUCCESS)
    
    Nov 14 17:29:52 linux-w869.site su[3312]: (to postgres) root on none
    Nov 14 17:29:52 linux-w869.site su[3312]: pam_unix(su-l:session): session opened for user postgres by (uid=0)
    Nov 14 17:29:52 linux-w869.site su[3343]: (to postgres) root on none
    Nov 14 17:29:52 linux-w869.site su[3343]: pam_unix(su-l:session): session opened for user postgres by (uid=0)
    Nov 14 17:29:53 linux-w869.site postgresql[3297]: Starting PostgreSQL 9.3.5 ..done
    Next I log in as user postgres and create a user:
    Code:
    psql -c "CREATE USER tryton WITH CREATEDB;" 
    psql -c "ALTER ROLE tryton WITH PASSWORD 'DBAdminPassword';"
    Next I log in as user tryton and try to connect to the DB:
    Code:
    tryton@linux-w869:/home/test> psql -l
                                      Liste der Datenbanken
       Name    | Eigentümer | Kodierung | Sortierfolge | Zeichentyp  |  Zugriffsprivilegien  
    -----------+------------+-----------+--------------+-------------+-----------------------
     postgres  | postgres   | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | 
     template0 | postgres   | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | =c/postgres          +
               |            |           |              |             | postgres=CTc/postgres
     template1 | postgres   | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | =c/postgres          +
               |            |           |              |             | postgres=CTc/postgres
    (3 Zeilen)
    So far, so good, the user sees the database, but when he wants to connect:
    Code:
    tryton@linux-w869:/home/test> psql -h localhost -p 5432 -U tryton -W
    Passwort für Benutzer tryton: 
    psql: FATAL:  Ident-Authentifizierung für Benutzer „tryton“ fehlgeschlagen
    Any idea what the reason could be? Same worked like a charm under 13.1

  2. #2

    Default Re: Postgres 9.3.5 on openSUSE 13.2 - login to DB not possible anymore

    Quote Originally Posted by DocB View Post
    Hi
    I installed postgres on openSUSE 13.2 and used it as before, but cant log in anymore.
    Was there a mayor change towards 13.1?
    Postgres Server starts:
    Code:
    linux-w869:/home/test # systemctl status postgresql
    postgresql.service - LSB: Start the PostgreSQL master daemon
       Loaded: loaded (/etc/init.d/postgresql)
       Active: active (exited) since Fr 2014-11-14 17:29:53 CET; 2s ago
      Process: 3224 ExecStop=/etc/init.d/postgresql stop (code=exited, status=0/SUCCESS)
      Process: 3297 ExecStart=/etc/init.d/postgresql start (code=exited, status=0/SUCCESS)
    
    Nov 14 17:29:52 linux-w869.site su[3312]: (to postgres) root on none
    Nov 14 17:29:52 linux-w869.site su[3312]: pam_unix(su-l:session): session opened for user postgres by (uid=0)
    Nov 14 17:29:52 linux-w869.site su[3343]: (to postgres) root on none
    Nov 14 17:29:52 linux-w869.site su[3343]: pam_unix(su-l:session): session opened for user postgres by (uid=0)
    Nov 14 17:29:53 linux-w869.site postgresql[3297]: Starting PostgreSQL 9.3.5 ..done
    Next I log in as user postgres and create a user:
    Code:
    psql -c "CREATE USER tryton WITH CREATEDB;" 
    psql -c "ALTER ROLE tryton WITH PASSWORD 'DBAdminPassword';"
    Next I log in as user tryton and try to connect to the DB:
    Code:
    tryton@linux-w869:/home/test> psql -l
                                      Liste der Datenbanken
       Name    | Eigentümer | Kodierung | Sortierfolge | Zeichentyp  |  Zugriffsprivilegien  
    -----------+------------+-----------+--------------+-------------+-----------------------
     postgres  | postgres   | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | 
     template0 | postgres   | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | =c/postgres          +
               |            |           |              |             | postgres=CTc/postgres
     template1 | postgres   | UTF8      | de_DE.UTF-8  | de_DE.UTF-8 | =c/postgres          +
               |            |           |              |             | postgres=CTc/postgres
    (3 Zeilen)
    So far, so good, the user sees the database, but when he wants to connect:
    Code:
    tryton@linux-w869:/home/test> psql -h localhost -p 5432 -U tryton -W
    Passwort für Benutzer tryton: 
    psql: FATAL:  Ident-Authentifizierung für Benutzer „tryton“ fehlgeschlagen
    Any idea what the reason could be? Same worked like a charm under 13.1
    1. Modify pg_hba.conf from /var/lib/pgsql/data/
    2. Change method of identification from "ident" to "md5"
    3. exit from editor
    4. sudo su
    5. rcpostgresql restart (basically to restart postgresql server)

    Hope that works. (It works for me)

  3. #3
    Join Date
    Jun 2008
    Location
    Düsseldorf/Germany
    Posts
    244

    Default Re: Postgres 9.3.5 on openSUSE 13.2 - login to DB not possible anymore

    Quote Originally Posted by yaoting2 View Post
    1. Modify pg_hba.conf from /var/lib/pgsql/data/
    2. Change method of identification from "ident" to "md5"
    3. exit from editor
    4. sudo su
    5. rcpostgresql restart (basically to restart postgresql server)
    Yes, after changing the method to MD5 or trust at least this error message does not appear anymore.
    Now it says 'Can not connect to database 'tryton'. Obvious, as this database was not created yet. But that is also not what the command asks for.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •