Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change postgresql listening port in windows?

How do i change the default listening port 5432 of postgresql to another number?

Another question,

What steps do i have do to allow remote r/w access to the database using python pyscopg2?

like image 754
goh Avatar asked Jun 03 '10 08:06

goh


People also ask

How do I change the port in PostgreSQL?

Open the postgresql configuration file in any text edit. The default file location is C:\Program Files\PostgreSQL\<version>\data. Change the port number in the Connections and Authentication section of the configuration file. Choose File > Save to save the new port number.

How do I open port 5432 on Windows?

As an alternative you can go to Control Panel -> Systems and Security -> Windows Firewall -> Allow a program or feature through Windows Firewall -> Advanced Settings -> New Rule: Rule Type: Port. TCP or UDP: TCP. Specific local ports: 5432.

Which port is PostgreSQL listening on?

By default, the Postgresql database listens on port 5432.


1 Answers

Just change the setting in the file postgresql.conf (can be found in the data directory):

port = 5433             # (change requires restart)

Remote access can be given by changing pg_hba.conf, just add the ip-address. You also have to edit postgresql.conf:

listen_addresses = '*'
like image 50
Frank Heikens Avatar answered Oct 18 '22 23:10

Frank Heikens