Firebird error "username and password are not defined" with Delphi application
Asked Answered
D

5

28

I have an application made with Delphi 2006 and Firebird 2.5. For connection a use Interbase components from Delphi. I setting up in design time a TIBDatabase with username, password tc, and work ok, but when i want to run application in another pc (first i install Firebird 2.5 on it), i received this error:

Statement failed, SQLSTATE = 28000

Your user name and password are not defined. Ask your database administrator to set up a Firebird login.

What is this? How can I resolve that?

Dopey answered 24/11, 2010 at 23:9 Comment(0)
M
21

The message clearly states the username and password you're using to connect at design time in your development machine are not valid to the database server you're trying to connect on the other machine (let's call it production). From your message it seems it is not the same server you connect to at design time.

I suggest you to test this issue with ease to put the LoginPrompt property to true on the TIBDatabase component to allow it to ask the user for propper credentials before connecting. You will be able to connect using any valid username/password combination for that server. To be sure the combination are valid, try to connect using the isql command line tool, for example the command

c:\test>isql test.fdb -u sysdba -p masterkey

will connect to c:\test\test.fdb using default username and password. (the firebird root directory must be in the path environment variable for this to work)

Also, you can use the gsec command line tool to adjust the password for this engine or you can provide the create users and change passwords on that production machine before trying to connect to it.

On Windows, firebird default sysdba password is masterkey.

Manado answered 25/11, 2010 at 4:29 Comment(2)
Firebird password length is limited to 8 characters... so masterke is enough enough to get you into Firebird. This used to be the case in Interbase but I haven't tried that since IB 6Procopius
There's a great getting started walkthrough here.Liana
M
6

The solution that finally worked for me on windows was starting cmd.exe as administrator and running "C:\Program Files (x86)\Firebird\Firebird_3_0\gsec.exe" -user sysdba -password masterkey -mo sysdba -pw masterkey

Msg answered 27/3, 2020 at 21:23 Comment(0)
O
3

This error is because the credentials for Firebird db is simply not stored in the database file. It's stored in the configuration file on the Firebird Server. If you copy over the DB file, and not the password -- you will have a different password.

On Ubuntu machines you can find out the password and username in the file, /etc/firebird/<version>/SYSDBA.password

It'll look something like,

ISC_USER=sysdba
ISC_PASSWORD="password"

Use those credentials to connect to the database file.

Onomasiology answered 2/5, 2014 at 19:28 Comment(6)
That is not quite correct, user account information including password is stored inside the security database (with more options like using operating system authentication in more recent versions), but not in a configuration file.Jamisonjammal
I don't understand your correction, the password in the conf file SYSDBA.password is certainly what isql wants.Onomasiology
First there is no connection with Ubuntu in the question. Second it's possible to change the SYSDBA password on a Ubuntu machine without changing the SYSDBA.password content, by using Firebird-native ways of modifying that password instead of the administration script.Jamisonjammal
@Jamisonjammal could I know where's the reference to change the SYSDBA password without changing the SYSDBA password content? I'm having the same problem,Bunsen
@otong: As written in the most upvoted answer, use the gsec tool on the machine with the server.Jamisonjammal
@Jamisonjammal lol we dont even know what the sysdba password is, while running gsec requires sydba password. what are you talking about really? :D I'm sorry if my words look offended, didnt mean to. But im crying here finding a way to reset the sysdba password.Payment
A
2

At 'isql-fb' from linux terminal and after the 'CONNECT' on database: - I solved after delete(drop) and recreate the 'SYSDBA' user.

Observation: I had problems with file and folder permission at '/tmp/firebird' and I needed to use 'sudo' or root to open 'isql-fb'

Thanks.

Atahualpa answered 3/5, 2017 at 17:35 Comment(4)
DROP USER 'SYSDBA'; CREATE USER 'SYSDBA' PASSWORD 'masterkey'; ALTER USER 'SYSDBA' GRANT ADMIN ROLE;Atahualpa
What do you mean after the 'CONNECT' on the database? I have the same error, but it appears when I try to connect to the database. So no chance to run the 'DROP' etcBunsen
You can open 'isql-fb' without specifying the connection parameters. And the "CONNECT" it's a command for use inside isql-fb: firebirdsql.org/pdfmanual/html/isql-connect-database.html When you use isql-fb, maybe you can access your database with "connect" command.Atahualpa
in my case, "connect" command need username and password. it says "Your user name and password are not defined."Kasi
J
1

I once got this error trying to connect to a Firebird 3.0.3 database using the Firebird 2.5 client libraries. I just forgot to update the client libraries to 3.0.3. Maybe this will help someone.

Jaggy answered 12/9, 2018 at 13:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.