PostgreSQL 8 beginner log

Install Postgresql 8 on Ubuntu 7.10 through apt-get

Client machine using WinXP and PgAdmin 3.

At first, after installed postgresql without any config, I cannot access this database under windows XP using PgAdmin, even if I have correct username and password.

After digging into the web, I found this article. The correct process to access postgresql which does not use localhost are as follow:

1. Go to /etc/postgresql/8.2/main/pg_hba.conf
2. Add this line below the localhost(127.0.0.1/32) IPv4 connection: host all all <your_preferred_IP_address> trust

Yes, don't use "md5" but use "trust" first.

3. You can now successfully using PgAdmin in Windows to connect to this DB server in Linux.
4. In PgAdmin, expand the "login role"(Or something about user), find the user "postgres" > right click this user > select "properties" >Enter the password for this user account > click "OK".

5. Finally, go back to Linux, open and edit pg_hba.conf. Change back the word from "trust" to "md5"
6. Reload (or restart) your postgresql.
7. Disconnect from PgAdmin and reconnect using postgres account with the password you set previously. You should now be able to login under PgAdmin, with md5 available.

Hope it helps someone.




Powered by ScribeFire.

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

How to fix fancy box/Easy Fancybox scroll not work in mobile

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services