ChinaUnix.net
相关文章推荐:

c# 远程连接postgreSQL

我的情况如下: 有两台机器,操作系统linux下,postgresql版办是6.4的,设置了postgresql.conf 中的tcpip_socket= true 和pg_hba.conf,使得两台机器在shell提示符下用:$psql -h ip -d dbname可以相互访问。 可是不知道在C++用libpq库怎么访问远程postgresql数据库。 postgresql 提供了两个接口函数设置环境变量,对于第二个接口函数我不太明白,两个接口函数如下: PgEnv(); PgEnv(const string& auth, const string& h...

by cizi - C/C++ - 2004-09-08 22:11:10 阅读(1718) 回复(2)

相关讨论

众所周知,Postgres 8.1 分别发行了 Linux和Windows 两个版本,
所以,介绍远程连接的主题时,也是分别介绍这两个系统上是如何实现的。
其实,windows版比linux版的步骤少一些。

一、实现远程连接Linux上的postgresql服务器。
主要分两个步骤:
<1>要使Linux上的postgresql打开 “unix的tcpip套接子”。
编辑 $POSTGRES/data/postgresql.conf 文件,
将tcpip_socket=off改成tcpip_socket=on即...

by jackson198574 - MySQL - 2011-12-19 13:55:12 阅读(685) 回复(0)

PGconn *PQconnectdb(const char *conninfo) db_local = PQconnectdb("dbname = dbname1"); db_remote = PQconnectdb("hostaddr = 'hostip', dbname = 'dbname2'); 这样连接可以吗?

by cizi - C/C++ - 2004-09-15 11:32:16 阅读(1472) 回复(5)

日志: 无法联接到地址为 "::1", 端口为 113 的 Ident 服务器: 拒绝连接 致命错误: 用户 "postgres" Ident 认证失败 pg_hba.log

by zhaofus - PostgreSQL - 2012-06-26 14:50:12 阅读(4071) 回复(6)

现在有个程序数据库用的是oracle,现在需要移植到postgresql中。因此在源码和配置文件中做了些修改,但是在登录时就提示如下的错误,不知道哪里的原因? HTTP Status 500 - IO Error: The Network Adapter could not establish the connection -------------------------------------------------------------------------------- type Exception report message IO Error: The Network Adapter could not establish the con...

by Zoelov - Web开发 - 2014-03-18 16:57:17 阅读(1275) 回复(0)

使用PQconnectdb时出现错误如下: could not get socket error status: Invalid argument 想问下这是由于什么引起的,万分感谢

by wuzen007 - PostgreSQL - 2014-01-03 15:29:49 阅读(2296) 回复(2)

c/c++怎样连接本机postgresql数据库,还有在表中读取和插入数据是什么格式的?

by jenliang - PostgreSQL - 2012-01-30 10:59:35 阅读(3614) 回复(2)

C:\Windows\system32>psql psql: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "???" and accepting TCP/IP connections on port 5432? 错误就是这样的。有谁能解答啊?谢谢。。。万分感谢。。。。

by qj_zhai - PostgreSQL - 2012-03-19 09:39:59 阅读(1843) 回复(3)

在服务端按要求做好了server.key server.crt ; 在postgresql.conf中打开了SSL 选项; 在pg_hba.conf中设置了SSL登陆的账号:hostssl all all 192.168.0.2/32 md5; 用postgresql的命令行登陆显示是加密的了; 用psycopg2去连接数据库 conn = psycopg2.connect(database="testDB", user="testssl", host="192.168.0.1",port="5432",password="123456",sslmode="require") 是不是就可以使用SSL加密了?? 请高手帮我看看我的理解是...

by 我不是老手 - Python - 2011-07-31 15:42:53 阅读(2304) 回复(0)

数据库需要脱机,但是pg好像不支持。 在网上找了半天,没找到相关的贴子。官方好像说可以用第三方工具关掉tcp连接。然后补了一句,重启是最简单的办法。顿时晕。 如果数据库要是有很多并发链接,刚刚重启完,又脱不了机了。 这是哪门子事情啊,商业方面也太差了点。 刚刚接触pg不久,哪位能告知是否还有其它的办法?

by xielk - PostgreSQL - 2010-05-12 07:57:13 阅读(3002) 回复(1)

在window2000操作系统下,在.java中写入: Class.forName("org.postgresql.Driver"); conn = DriverManager.getConnection("jdbc:postgresql://192.168.0.8/user", "haoyuan", "haoyuan"); 运行结果出现下面错误: Something unusual has occured to cause the driver to fail. Please report this exception: java.sql.SQLException: FATAL 1: No pg_hba.conf entry for host 192.168.0.8, user haoyuan, database user 请问:哪...

by 流浪的老鼠 - PostgreSQL - 2003-07-27 15:42:34 阅读(2857) 回复(4)