`
darkjune
  • 浏览: 303128 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

解决 dropdb: could not connect to database postgres: could not connect to server:

 
阅读更多

今天在调试一个脚本的时候遇到这个错误:

dropdb: could not connect to database postgres: could not connect to server: 

这个脚本调用了postgresql的dropdb命令。

找了下资料似乎是dropdb时候找的库不对导致的。 由于这个脚本以前是对本机postgreSQL操作的,这次是对remote的postgreSQL操作的,所以测试了一下差异:

./dropdb -U postgres mydbase 默认对本机数据库操作

./dropdb -U postgres dsvdbase -h 10.**.**.**  加上了IP地址,对此IP的数据库操作

 

所以由于脚本所在服务器没有装postgreSQL,出了错, 给这个脚本填加-h解决

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics