如何在Windows中更改Postgresql侦听端口? [英] how to change postgresql listening port in windows?

查看:424
本文介绍了如何在Windows中更改Postgresql侦听端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Postgresql的默认侦听端口5432更改为另一个数字?

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

另一个问题,

我应该采取哪些步骤来允许使用python pyscopg2远程读写数据库?

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

推荐答案

只需更改文件postgresql.conf中的设置(可以在数据目录中找到):

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

port = 5433             # (change requires restart)

可以通过更改 pg_hba.conf来提供远程访问. ,只需添加ip地址.您还必须编辑postgresql.conf:

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

listen_addresses = '*'

这篇关于如何在Windows中更改Postgresql侦听端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆