Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux ubuntu中的postgres连接被拒绝_Linux_Networking_Ubuntu_Service_Database Connection - Fatal编程技术网

Linux ubuntu中的postgres连接被拒绝

Linux ubuntu中的postgres连接被拒绝,linux,networking,ubuntu,service,database-connection,Linux,Networking,Ubuntu,Service,Database Connection,远程连接时出错,该错误表示 无法连接到服务器:连接超时(0x0000274C/10060)服务器是否在主机x上运行并在端口5432上接受TCP/IP连接 请帮帮我打开你的终端并写下 service postgresql status 如果它说它没有运行,那么就写 service postgresql start 如果服务已在运行,请通过检查postgresql服务的侦听端口 netstat -an | grep postgresql 结果将显示它正在侦听的端口。然后您可以使用命令连接数据库

远程连接时出错,该错误表示

无法连接到服务器:连接超时(0x0000274C/10060)服务器是否在主机x上运行并在端口5432上接受TCP/IP连接


请帮帮我打开你的终端并写下

service postgresql status
如果它说它没有运行,那么就写

service postgresql start
如果服务已在运行,请通过检查postgresql服务的侦听端口

netstat -an | grep postgresql
结果将显示它正在侦听的端口。然后您可以使用命令连接数据库

psql -h localhost -p port_you_found -U postgres

打开您的终端并写入

service postgresql status
如果它说它没有运行,那么就写

service postgresql start
如果服务已在运行,请通过检查postgresql服务的侦听端口

netstat -an | grep postgresql
结果将显示它正在侦听的端口。然后您可以使用命令连接数据库

psql -h localhost -p port_you_found -U postgres

请查看此命令的输出:
netstat-lp
在应该运行postgresql的服务器上。连接超时几乎总是意味着防火墙会阻止连接。您可以在服务器(本地)上连接吗?尝试在shell上以postgres用户身份登录并执行psql:
su-postgres-cpsql
。并检查postgresql.conf上的
listen\u address
的值,应该是
*
或IP。请查看此命令的输出:
netstat-lp
,在应该运行postgresql的服务器上。连接超时几乎总是意味着防火墙会阻止连接。您可以在服务器(本地)上连接吗?尝试在shell上以postgres用户身份登录并执行psql:
su-postgres-cpsql
。并检查postgresql.conf上的
listen\u address
的值,应为
*
或IP。