473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Connecting to Firebird database using Kinterbasdb+Python

Hi,

I've been using FB1.5 and access the database using Kinterbasdb +
Python. My connection is established using kinterbasdb.connect() method
and the parameters host, dns, database, user, password are all defaulted
to 'None'.

On my own machine running Mac OSX 10.3, I can connect using the following:
host = 'localhost'
database = '<my path to FB database>'
user = '<user>'
password = '<password>'

At the same time, I can also connect if I set host=None on my machine.

However, I cannot use 'localhost' on a shared Linux machine (not
allowed. Don't ask why, system admin's mandate. And the Linux machine is
without inetd). So when I set host=None, I get this error:

Connecting to Muscopedia Database
Connection:
localhost:/mnt/disk/home/mling/muscorian/BioDatabases/muscopedia.fdb:mouse:mouse
<-- default
None <-- actual host (with 'print self.dbhost' where
kinterbasdb.connect(host = self.dbhost,.....)
OperationalError
(-902, 'isc_attach_database: Unable to complete network request to host
"localhost".. Failed to establish a connection.. Connection refused. ')
File "muscorian.py", line 641, in main
result = mosys.run(command)

File "muscorian.py", line 597, in run
elif (command[0] == 'linkmuscopedia'):
self.commandLinkMuscopediaDB(command)

File "muscorian.py", line 129, in commandLinkMuscopediaDB
self.muscopedia = PubMedGrabber.FBUtilities(str(command[1]))

File "abcrawl/PubMedGrabber.py", line 340, in __init__
user = self.dbuser, password = self.dbpwd, charset='UNICODE_FSS')

File "/usr/lib/python2.2/site-packages/kinterbasdb/__init__.py", line
470, in connect
return Connection(*args, **keywords_args)

File "/usr/lib/python2.2/site-packages/kinterbasdb/__init__.py", line
608, in __init__
self._C_con = _k.attach_db(dsn, dpb, dialect)

Any ideas or solutions?

Thanks in advance.

Cheers
maurice
Jul 21 '05 #1
5 4552
Maurice LING wrote:
I've been using FB1.5 and access the database using Kinterbasdb +
Python. My connection is established using kinterbasdb.connect() method
and the parameters host, dns, database, user, password are all defaulted
to 'None'.

On my own machine running Mac OSX 10.3, I can connect using the following:
host = 'localhost'
database = '<my path to FB database>'
user = '<user>'
password = '<password>'

At the same time, I can also connect if I set host=None on my machine.

However, I cannot use 'localhost' on a shared Linux machine (not
allowed. Don't ask why, system admin's mandate. And the Linux machine is
without inetd). So when I set host=None, I get this error:


Just for my understanding: if you start your script on the machine hosting
the DB you're able to connect. If you start it on a different machine, you
are not able to connect without giving a hostname? Whats wrong with
offering the the name (or IP-address) of your MacOS-box instead of
'localhost' to the script?

Mathias

Jul 21 '05 #2
How is your Firebird database configured -- Classic Server or Super
Server? If it's in classic server mode, you don't need to worry about
the host portion. You do need to worry about permissions on the
database file. I got it to work by making it 664 and owner + group
firebird.

Grig

Jul 21 '05 #3
Mathias Waack wrote:
Maurice LING wrote:

I've been using FB1.5 and access the database using Kinterbasdb +
Python. My connection is established using kinterbasdb.connect() method
and the parameters host, dns, database, user, password are all defaulted
to 'None'.

On my own machine running Mac OSX 10.3, I can connect using the following:
host = 'localhost'
database = '<my path to FB database>'
user = '<user>'
password = '<password>'

At the same time, I can also connect if I set host=None on my machine.

However, I cannot use 'localhost' on a shared Linux machine (not
allowed. Don't ask why, system admin's mandate. And the Linux machine is
without inetd). So when I set host=None, I get this error:

Just for my understanding: if you start your script on the machine hosting
the DB you're able to connect. If you start it on a different machine, you
are not able to connect without giving a hostname? Whats wrong with
offering the the name (or IP-address) of your MacOS-box instead of
'localhost' to the script?


Hi Mathias,

What I am trying to do is "port" a workable program from my own machine
(Mac OSX) to a larger machine (Linux). So, the DB and the program are
also on the same Linux machine.

On the Linux machine, I cannot use localhost, so I set host parameter in
kinterbasdb.connect() method to None, which is the default kinterbasdb
uses. On Linux machine, I get the error as posted. On my Mac OSX
machine, initiating host parameter to 'localhost' or None has no
difference, it works.

Thanks and cheers
Maurice
Jul 21 '05 #4
On Tue, 05 Jul 2005 09:35:25 +1000, Maurice LING <ma*********@acm.org>
declaimed the following in comp.lang.python:

On the Linux machine, I cannot use localhost, so I set host parameter in
So... Does the machine have a defined name? Plug that name into
the connect.

Or just hard-code "127.0.0.1", the loopback IP # that normally
is assigned to "localhost" <G>
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 21 '05 #5
Maurice LING wrote:
What I am trying to do is "port" a workable program from my own machine
(Mac OSX) to a larger machine (Linux). So, the DB and the program are
also on the same Linux machine.

On the Linux machine, I cannot use localhost, so I set host parameter in
kinterbasdb.connect() method to None, which is the default kinterbasdb
uses. On Linux machine, I get the error as posted. On my Mac OSX
machine, initiating host parameter to 'localhost' or None has no
difference, it works.


How do you connect to the Linux-DB using tools like isql?

Check you firebird config (most likely in /etc/firebird2/firebird.conf) for
the parameters "RemoteServicePort" and "RemoteBindAddress". And at least
try "netstat -alp | grep fbserv" (as root) to check if the firebird is
running properly.

If you're running the classic server you can simply follow Grig's advice and
connect "directly" to the db files.

Mathias
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MiLF | last post by:
Is it possible to write a Audio CD Player by using python only?
0
by: Jon Moldover | last post by:
Hi, I'm using Python in my win32 app by linking to the python23.dll. I'm trying to expose some c++ code in my app to Python so I can make application calls from Python scripts (according to the...
4
by: The_Incubator | last post by:
As the subject suggests, I am interested in using Python as a scripting language for a game that is primarily implemented in C++, and I am also interested in using generators in those scripts... ...
8
by: Sridhar R | last post by:
Hi, I am a little experienced python programmer (2 months). I am somewhat experienced in C/C++. I am planning (now in design stage) to write an IDE in python. The IDE will not be a simple...
8
by: Joakim Persson | last post by:
Hello all. I am involved in a project where we have a desire to improve our software testing tools, and I'm in charge of looking for solutions regarding the logging of our software (originating...
0
by: P. Adhia | last post by:
Hello, I was wondering if anyone is successfully using using Python(2.5)+DB2+pydb2. I get an error in all situations. It seems that this problem might be limited to python 2.5. A quick Google...
9
by: dominiquevalentine | last post by:
Hello, I'm a teen trying to do my part in improving the world, and me and my pal came up with some concepts to improve the transportation system. I have googled up and down for examples of using...
53
by: Vicent Giner | last post by:
Hello. I am new to Python. It seems a very interesting language to me. Its simplicity is very attractive. However, it is usually said that Python is not a compiled but interpreted programming...
0
by: fatimang | last post by:
can someone give me codes or things to use on connecting Python to MS Access. thank you in advance.. GOD BLESS..
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.