python fdb,尝试连接到外部Firebird 1.5超级服务器 [英] python fdb, trying to connect to an external firebird 1.5 super server

查看:109
本文介绍了python fdb,尝试连接到外部Firebird 1.5超级服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Python fdb libary从本地计算机连接到服务器上的Firebird 1.5数据库. 但我没有运气.
服务器是运行Firebird 1.5.6作为服务的Windows 2008服务器R1.它还具有一个名为firebird的系统DSN.
我如何通过python连接到它?我正在使用此代码:

I'm trying to connect to a Firebird 1.5 database that is located on a server, from my local machine with Python fdb libary. but I'm having no luck.
the server is windows 2008 server R1 running Firebird 1.5.6 as a service. It also has a System DSN called firebird.
How can i connect to it via python? I'm using this code:

import fdb
db = fdb.connect(host='192.168.40.28', database="C:\databases\database12.GDB", user='admin', password='admin')

但它会产生以下结果:

Traceback (most recent call last):
  File "data.py", line 4, in <module>
    db = fdb.connect(host='192.168.40.28', database="C:\databases\database12.GDB", user='admin', password='admin')
  File "/usr/local/lib/python2.7/dist-packages/fdb/fbcore.py", line 666, in connect
    "Error while connecting to database:")
fdb.fbcore.DatabaseError: ('Error while connecting to database:\n- SQLCODE: -902\n- Unable to complete network request to host "192.168.40.28".\n- Failed to establish a connection.', -902, 335544721)

我在做什么错了?

推荐答案

假设IP 192.168.40.28是正确的,我的下一个问题是您没有打开端口3050(这是Firebird的默认端口) ).检查服务器的防火墙并打开端口.您可以通过在firebird.conf文件中设置RemoteServicePort参数来使用其他端口来代替3050,但是随后您也必须在connect方法中设置端口参数.

Assuming that the IP 192.168.40.28 is correct my next quess would be that you don't have the port 3050 open (thats the default port for Firebird). Check your server's firewall and open the port. You can use some other port instead of 3050 by seting the RemoteServicePort parameter in the firebird.conf file, but then you have to set the port parameter in the connect method too.

这篇关于python fdb,尝试连接到外部Firebird 1.5超级服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆