postgresql 更改 pgsql 端口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/187438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
change pgsql port
提问by Bhavik
I have currently an installed pgsql instance that is running on port 1486
. I want to change this port to 5433
, how should I proceed for this?
我目前有一个在端口上运行的已安装 pgsql 实例1486
。我想将此端口更改为5433
,我应该如何进行此操作?
回答by Neall
There should be a line in your postgresql.conf
file that says:
您的postgresql.conf
文件中应该有一行说:
port = 1486
Change that.
改变那个。
The location of the file can vary depending on your install options. On Debian-based distros it is /etc/postgresql/8.3/main/
该文件的位置可能因您的安装选项而异。在基于 Debian 的发行版上,它是/etc/postgresql/8.3/main/
On Windows it is C:\Program Files\PostgreSQL\9.3\data
在 Windows 上是 C:\Program Files\PostgreSQL\9.3\data
Don't forget to sudo service postgresql restart
for changes to take effect.
不要忘记sudo service postgresql restart
让更改生效。