How to connect fdb database using Python in Ubuntu?

135 Views Asked by At

I am trying to connect fdb database using python. I am remotely connected to ubuntu. I have tried this:

path = '/home/ubuntu/Firebird4.0/A.fdb'
con = fdb.connect(host=host, database=path, user=user, password=pswd2, charset='UTF8')

and many combinations for the path of ubuntu fdb file. How can I solve this problem? Is it about the wrong host, port, password, or something? I got this error all the time

Traceback (most recent call last):
  File "/home/ubuntu/test.py", line 24, in <module>
    conn = connection()
  File "/home/ubuntu/test.py", line 15, in connection
    con = fdb.connect(host=host, database=path, user=user, password=pswd2, charset='UTF8')
  File "/home/ubuntu/.local/lib/python3.10/site-packages/fdb/fbcore.py", line 869, in connect
    raise exception_from_status(DatabaseError, _isc_status,
fdb.fbcore.DatabaseError: ('Error while connecting to database:\n- SQLCODE: -902\n- Unable to complete network request to host "15.206.100.218".\n- Failed to establish a connection.', -902, 335544721)
0

There are 0 best solutions below