win10运行PostgreSQL错误:psql: 无法联接到服务器
2023-09-27 14:21:38 时间
win10运行PostgreSQL错误:psql: 无法联接到服务器
3
篇文章0
订阅
win10安装好PostgreSQL之后,在运行SQL Shell,输入密码之后,有时候会出现下面的错误信息,那是因为win10服务中没有PostgreSQL的服务器,所以连接不上。
psql: 无法联接到服务器: Connection refused
(0x0000274D/10061)
服务器是否在主机 "localhost"(::1) 上运行并且准备接受在端口
5432
上的 TCP/IP 联接?
无法联接到服务器:
Connection refused (0x0000274D/10061)
服务器是否在主机 "localhost"(127.0.0.1) 上运行并且准备接受在端口
5432
上的 TCP/IP 联接?
要解决这个问题,其实很简单,就是注册一个服务器,然后再认为启动即可。
第一步:使用管理员身份运行DOS命令窗口
第二步:将工作目录修改到PostgreSQL下bin目录中,因为这个目录有很多运行程序
第三步:运行命令:
pg_ctl.exe register -N "postgresql-x64-13" -D "D:/Program Files/PostgreSQL/11/data"
postgresql-x64-13:表示我新注册服务器的名称,可以自己随意命令
"D:/Program Files/PostgreSQL/11/data":表示服务器数据保存的位置,一定要在PostgreSQL目录下的data文件夹中
第四步:
-
打开控制面板
-
找到管理工具,并打开
-
找到服务,双击打开
-
找到服务器postgresql-x64-13,右键选择启动
完成这四步即可。
相关文章
- 配置错误定义了重复的“system.web.extensions/scripting/scriptResourceHandler” 解决办法
- C语言使用以及其它语言经常出的错误
- python import 错误 TypeError: 'module' object is not callable
- Key exchange was not finished,connection is closed近期遇到这个错误sshd更新导致的
- 修改PostgreSQL字段长度导致cached plan must not change result type错误
- 修改PostgreSQL字段长度导致cached plan must not change result type错误(转载)
- Unable to locate package错误解决办法
- logcat错误日志
- 如何解决ubuntu报的错误:You must put some 'source' URIs in your sources.list
- Nginx500错误
- CentOS安装错误:no default or ui configuration
- PostgreSQL小知识:column "..." does not exist、字符串转整数integer、sql排查错误
- 浅析promise捕获错误方式、用try catch可以捕获promise错误吗、try catch和promise的catch有什么区别、try catch为什么不能捕获异步错误
- 恢复数据库时遇到无法独占错误
- Qt 4.8.6 PCL 1.8.0 VS 2010 联合编译常见错误
- AD20/Altium designer——如何进行DRC检查、冲突的错误如何改正
- docker错误 legacy plugin:Post http://127.0.0.1:23750/Plugin.Activate: dial tcp 127.0.0.1:23750 refused