YES, of course there is a difference. Postgres is a linux user which postgresql runs on. To log in a linux postgres user you can first log in as root an then enter: su postgres. On the other hand you can log in as root, and enter: 'sudo -u postgres psql postgres' which will run the psql command as postgres user. Hope that helpful.
On Wed, May 6, 2009 at 11:30 AM, calibration <calibration(at)cargolux(dot)com>wrote:
> Dear Support,
> We have Postgresql 8.1
> It is the default database installed with our temperature datalogger
> LogWareIII from Hart Scientific.
>
> I have some troubles with this software and I have tried to enter in the
> PostgreSQL software. I have launch the application pgadminIII but it
> requests a Password. I have never installed a password so I think it's the
> default password. Could you please give me this information?
>
>
Your problem is not pgAdmin related which is what this list is about.
Anyway, Postgres doesn't have a default password. If your database runs on a
Linux server as root you can su to postgres user and then use psql to
connect to the database. Once connected you can change postgres password to
whatever you like in order to be able to login through pgAdmin.
ALTER USER postgres WITH PASSWORD = 'mysecretpass';
On Windows servers the postgres user password is required upon installing.
When lost it isn't recoverable.
Nevertheless there is a little trick to gain access to the database:
Modify file pg_hba.conf and add or change the line:
host all all 127.0.0.1/32 trust
Restart the postgres service and now login with psql or pgAdmin with user
postgres. None or any password will do as it will not be checked.
After changing the password modify again the line in pg_hba.conf to:
host all all 127.0.0.1/32 md5
Restart the postgres service and you are back on track.... hopefully.
Regards,
Fernando.
I've installed PostgreSQL 9.1 and pgadmin3 on Ubuntu Server 13.10.
I configured postgresql.conf with: listen_addresses = '*'
also I configured ph_hba.conf by changed peer connections to md5
Plus I reset the password of postgres by: sudo password postgres
then restarted the service with sudo /etc/init.d/postgresql restart
after that I tried to connect to the default PostgreSQL template database:
but login failed with this error message:
then I tried to login from the pgadmin, which gave me the same error.
I've read here that it might be a password expiry dates bugPostgreSQL user can not connect to server after changing password
but I couldn't solve it coz I cannot login with psql. Does anyone now how to resolve this issue?
EDIT
ph_hba file:
Screenshot:
karel3 Answers
You are confusing the password for the unix user 'postgres' with the database password for the database user 'postgres'. These are not the same.
You've locked yourself out, because you enabled md5
authentication for database user postgres
without setting a password for the database user postgres
.
Add a new line to the top of pg_hba.conf
:
then restart/reload PostgreSQL and:
From the resulting prompt:
then remove the line you added to pg_hba.conf
and restart Pg again. You can now use the password you set above to connect to PostgreSQL as the postgres
user.
To learn more, read the 'client authentication' chapter of the user manual and the docs on pg_hba.conf
.
![Postgres Default Password Postgres Default Password](https://chartio.com/images/social-image.jpg)
Try to modify the password of the database template1 using this:
in your pg_hba.conf
if it does not work then try with
then restart your data baseit will work fine..if you make trust then there is no need for password if you make MD5 then it will ask password...
stumblebeeprotected by Community♦Apr 17 '18 at 5:32
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?