如何将postgresql的默认监听端口5432更改为其他号码?
还有一个问题,
我需要执行哪些步骤才能允许使用 python pyscopg2 远程读写访问数据库?
只需更改文件中的设置
postgresql.conf
(可以在data
目录中找到):
port = 5433 # (change requires restart)
可以通过更改 pg_hba.conf 来提供远程访问,只需添加 IP 地址即可。您还必须编辑
postgresql.conf
:
listen_addresses = '*'