0

I want to access a gdb file with python. I'm new to firebird and interbase.

I can access my file with this command: (Debian 8.4) isql-fb mydb.gdb

How can I connect to same file with Python? I tried fdb and kinterbasdb and always get an error message:

I have tried these lines:

con = fdb.connect(dsn='/home/bruno/Desktop/mydb.gdb')
con = fdb.connect(dsn='localhost:/home/bruno/Desktop/mydb.gdb')
con = fdb.connect(dsn='/home/bruno/Desktop/mydb.gdb', user='SYSDBA', password='*****')

The error is always something like:

fdb.fbcore.DatabaseError: ('Error while connecting to database:\n- SQLCODE: -902\n- Your user name and password are not defined. Ask your database administrator to set up a Firebird login.', -902, 335544472)

Thank you for your help

Bruno Canongia
  • 514
  • 6
  • 12
  • 1
    are you sure the `user` and `password` in the third try were correct? – Tadhg McDonald-Jensen Jun 04 '16 at 16:43
  • Yeah, it's correct. I can access the original file just without user and password. The gdb file was not made on my pc, I just get it to work on it. – Bruno Canongia Jun 04 '16 at 16:45
  • Which Firebird version? Note that the username and password are required when connecting through Firebird server; leaving it out is only an option when using Firebird 3 embedded, so your first two connection strings are likely not valid. Also note that when connecting through the server, that the server needs access to the location of the database file. – Mark Rotteveel Jun 04 '16 at 17:12
  • Finally, Firebird and Interbase are not the same. Firebird was forked from Interbase in 2000, and although there are similarities, they are **not the same**, and databases cannot be shared between Firebird and Interbase. – Mark Rotteveel Jun 04 '16 at 17:14
  • The only way that I can use SELECT command is: sudo isql-fb mydb.gdb Without sudo doesn't work. I have to make this query using python. – Bruno Canongia Jun 04 '16 at 21:25

1 Answers1

1

Thank you all for your time. I solved it changing sysdba password with gsec. The password was ok in config file but not in security database.

Bruno Canongia
  • 514
  • 6
  • 12