Firebird 错误“用户名和密码未定义”与德尔福应用程序
我有一个用 Delphi 2006 和 Firebird 2.5 制作的应用程序。对于连接,请使用 Delphi 的 Interbase 组件。我在设计时设置了一个带有用户名、密码 tc 的 TIBDatabase,并且工作正常,但是当我想在另一台电脑上运行应用程序时(首先我在上面安装 Firebird 2.5),我收到此错误:
Statement failed, SQLSTATE = 28000
您的用户名和密码未定义。请您的数据库管理员设置 Firebird 登录。
这是什么?我该如何解决这个问题?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
该消息清楚地表明您在设计时在开发计算机中用于连接的用户名和密码对于您在其他计算机上尝试连接的数据库服务器无效(我们将其称为生产计算机) )。从您的消息来看,它似乎与您在设计时连接的服务器不同。
我建议您轻松测试此问题,将 TIBDatabase 组件上的 LoginPrompt 属性设置为 true,以允许它在连接之前询问用户正确的凭据。您将能够使用该服务器的任何有效用户名/密码组合进行连接。为了确保组合有效,请尝试使用 isql 命令行工具进行连接,例如该命令
将使用默认用户名和密码连接到 c:\test\test.fdb。 (firebird 根目录必须位于路径环境变量中才能工作)
此外,您可以使用 gsec 命令行工具来调整该引擎的密码,或者您可以在尝试之前在该生产计算机上提供创建用户并更改密码连接到它。
在 Windows 上,firebird 默认的 sysdba 密码是 masterkey。
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
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.
最终在 Windows 上对我有用的解决方案是以管理员身份启动 cmd.exe 并运行
"C:\Program Files (x86)\Firebird\Firebird_3_0\gsec.exe" -user sysdba -password masterkey -mo sysdba -pw主密钥
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
此错误是因为 Firebird 数据库的凭据根本没有存储在数据库文件中。它存储在 Firebird 服务器上的配置文件中。如果您复制数据库文件而不是密码,您将拥有不同的密码。
在 Ubuntu 机器上,您可以在文件
/etc/firebird//SYSDBA.password
中找到密码和用户名,它看起来像,
使用这些凭据连接到数据库文件。
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,
Use those credentials to connect to the database file.
在 Linux 终端的“isql-fb”处以及数据库上的“CONNECT”之后:
- 我在删除(删除)后解决并重新创建“SYSDBA”用户。
观察:我在 '/tmp/firebird' 处的文件和文件夹权限有问题,我需要使用 'sudo' 或 root 来打开 'isql-fb'
谢谢。
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.
我曾经在尝试使用 Firebird 2.5 客户端库连接到 Firebird 3.0.3 数据库时遇到此错误。我只是忘记将客户端库更新到 3.0.3。也许这会对某人有所帮助。
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.