当前位置:数据库 > Postgres >>

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


解决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解决
Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,