免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3483 | 回复: 3
打印 上一主题 下一主题

python连接postgresql问题,帮我看看. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-31 14:52 |只看该作者 |倒序浏览
from pyPgSQL import PgSQL
PgSQL.connect(host='jianguo',user='postgres',password='lzs643770',database='ShowRoom')

Traceback (most recent call last):
  File "<pyshell#14>", line 1, in -toplevel-
    PgSQL.connect(host='jianguo',user='postgres',password='lzs643770',database='ShowRoom',port='5432')
  File "C:\Python24\Lib\site-packages\pyPgSQL\PgSQL.py", line 2355, in connect
    return Connection(connInfo, client_encoding, unicode_results)
  File "C:\Python24\Lib\site-packages\pyPgSQL\PgSQL.py", line 2510, in __init__
    raise DatabaseError, m
DatabaseError: could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "jianguo" and accepting
        TCP/IP connections on port 5432?

应该是连接上的,为什么说不行呢.

论坛徽章:
0
2 [报告]
发表于 2006-05-31 15:11 |只看该作者
  1. DatabaseError: could not connect to server: Connection refused (0x0000274D/10061)
  2.          Is the server running on host "jianguo" and accepting
  3.          TCP/IP connections on port 5432?
复制代码

论坛徽章:
0
3 [报告]
发表于 2006-05-31 17:37 |只看该作者
client_encoding, unicode_results:你的pgsql的locale设置的是什么???

DatabaseError: could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "jianguo" and accepting
        TCP/IP connections on port 5432?
你在命令行下手动敲入这些相应的数据是否能够登录成功???

论坛徽章:
0
4 [报告]
发表于 2006-06-02 23:50 |只看该作者

你的postgresql没有打开允许tcp访问的选项

你的postgresql没有打开允许tcp访问的选项
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP