Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

psql fe_sendauth no password supplied

Tags:

postgresql

I am new to this type of database and I try to connect to it through the command line specifying psql, and then entering the password as blank. I get the above error (in the title of this question).

I dont know what the default password.

pg_hba file:

        IPv4 local connections:
    host    all             all             127.0.0.1/32            trust
    # IPv6 local connections:
    host    all             all             ::1/128                 trust
    # Allow replication connections from localhost, by a user with the
    # replication privilege.
    host    replication     DIMA        127.0.0.1/32            trust
    host    replication     DIMA        ::1/128                 trust

postgresql.config

listen_addresses = '*'      # what IP address(es) to listen on;
                    # comma-separated list of addresses;
                    # defaults to 'localhost', '*' = all
                    # (change requires restart)
port = 5432             # (change requires restart)

I restart the server this way:

C:\metasploit\postgresql\bin\pg_ctl -D "C:\metasploit\postgresql\myData" -l logfile start

All I want is to enter the database and change my password. And preferably to enter the PgAdmin-III (in GUI form)

like image 224
XWormX Avatar asked Aug 09 '13 18:08

XWormX


People also ask

How do I connect to PostgreSQL without a password?

Edit the pg_dba. conf file and change all local connections from md5 to trust. By doing this, you can log in to the PostgreSQL database server without using a password.

What is the password for psql?

To answer what is the default password for the PostgreSQL user, there isn't one. When connecting to PostgreSQL on Linux for the first time, many admins have this question, especially if they are from the MySQL world.

Where PostgreSQL password are stored?

PostgreSQL database passwords are separate from operating system user passwords. The password for each database user is stored in the pg_authid system catalog. Passwords can be managed with the SQL commands CREATE ROLE and ALTER ROLE, e.g., CREATE ROLE foo WITH LOGIN PASSWORD 'secret' , or the psql command \password .


1 Answers

If you were using trust authentication (which you should only use for development, if then) you would not be prompted for a password by psql.

I'd say you didn't properly restart the server. Maybe use restart instead of start?

like image 155
Craig Ringer Avatar answered Oct 11 '22 17:10

Craig Ringer