使用PSQL命令查找主机名和端口 [英] Find the host name and port using PSQL commands

查看:250
本文介绍了使用PSQL命令查找主机名和端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行PSQL,并且正在尝试使一个Perl应用程序连接到数据库。是否有命令查找数据库正在运行的当前端口和主机?

I have PSQL running, and am trying to get a perl application connecting to the database. Is there a command to find the current port and host that the database is running on?

推荐答案

默认PostgreSQL端口是 5432 。数据库所运行的主机应该由您的主机提供商提供;我想如果未指定,它将与网络服务器相同。通常,假设您的Web服务器和数据库服务器位于同一主机上,则将其配置为localhost。

The default PostgreSQL port is 5432. The host that the database is operating on should have been provided by your hosting provider; I'd guess it would be the same host as the web server if one wasn't specified. Typically this would be configured as localhost, assuming your web server and database server are on the same host.

这篇关于使用PSQL命令查找主机名和端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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