Firebird数据库SYSDBA连接错误 [英] Firebird database SYSDBA connection error

查看:443
本文介绍了Firebird数据库SYSDBA连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Firebird for Win64,并且试图连接到预包装有ISQL的员工数据库.
按照Firebird官方快速入门的步骤进行操作文档我打开了ISQL实用程序并输入:

I just installed Firebird for Win64, and I was trying to connect to the employee database which comes pre-packaged with ISQL.
Following the steps from the Firebird official QuickStart Documentation I opened the ISQL utility and entered:

connect localhost:employee user sysdba password masterkey;

结果我得到了:

Statement failed, SQLSTATE = 28000
Your user name and password are not defined. Ask your database administrator to set up a Firebird login.

最奇怪的是,如果我导航到员工数据库样本本身并从那里发出isql命令,我就可以成功连接.

Strangest thing is that if I navigate to the employee database sample itself and issue the isql command from there I can successfully connect.

推荐答案

不同之处在于,直接连接到数据库文件不需要密码,它甚至会忽略该密码,而仅使用提供的用户来知道哪个申请特权.

The difference is that connecting directly to a database file doesn't require a password, it will even ignore the password, and just use the provided user to know which privileges to apply.

在没有主机名的情况下,默认情况下,ISQL将使用Firebird嵌入式模式,而不是服务器.为了进行比较,请尝试使用isql employee.fdb(或isql employee),它将仅使用您当前的操作系统用户名登录,而isql localhost:employee将失败,并显示您的用户名和密码未定义".

Without a hostname, ISQL will by default use Firebird embedded mode, and not the server. To compare, try using isql employee.fdb (or isql employee), it will just login with your current OS username, while isql localhost:employee will fail with a 'Your user name and password are not defined'.

您似乎指定了与主密钥默认密码不同的密码,或者未初始化sysdba帐户.我记得较早的Firebird 3版本的安装程序存在问题,但我认为3.0.2不会受到此影响(或至少:它对我有用).

It looks like you specified a different password than the default of masterkey, or somehow the sysdba account wasn't initialized. I recall there was a problem with the installer of an earlier Firebird 3 version, but I don't think 3.0.2 should be affected by this (or at least: it worked for me).

如果未初始化SYSDBA帐户,请遵循Firebird 3发行说明的步骤,

If the SYSDBA account wasn't initialized, then follow the steps of the Firebird 3 release notes, section Initializing the Security Database:

初始化步骤

初始化是使用 isql 实用程序以嵌入式模式执行的. 对于嵌入式连接,不需要身份验证密码 如果您提供一个,它将被忽略.嵌入式连接将 无需登录凭据即可正常工作,并使用主机登录" 凭据(如果省略用户名).但是,即使用户 名称不受身份验证,创建或修改任何内容 现有安全数据库中的用户要求该用户为SYSDBA; 否则, isql 将为CREATE USER抛出特权错误 请求.

Initialization Steps

Initialization is performed in embedded mode using the isql utility. For an embedded connection, an authentication password is not required and will be ignored if you provide one. An embedded connection will work fine with no login credentials and "log you in" using your host credentials if you omit a user name. However, even though the user name is not subject to authentication, creating or modifying anything in the existing security database requires that the user be SYSDBA; otherwise, isql will throw a privilege error for the CREATE USER request.

SQL用户管理命令将与任何打开的数据库一起使用. 因为示例数据库employee.fdb存在于您的 安装并且已经在databases.conf中使用别名,这很方便 将其用于用户管理任务.

The SQL user management commands will work with any open database. Because the sample database employee.fdb is present in your installation and already aliased in databases.conf, it is convenient to use it for the user management task.

  1. 停止Firebird服务器. Firebird 3积极地缓存到安全数据库的连接.服务器连接的存在可能 阻止 isql 建立嵌入式连接.

  1. Stop the Firebird server. Firebird 3 caches connections to the security database aggressively. The presence of server connections may prevent isql from establishing an embedded connection.

在适当的外壳中,启动 isql 交互式会话,并通过其别名打开员工数据库:

In a suitable shell, start an isql interactive session, opening the employee database via its alias:

> isql -user sysdba employee

  • 创建SYSDBA用户:

  • Create the SYSDBA user:

    SQL> create user SYSDBA password 'SomethingCryptic';
    SQL> commit;
    SQL> quit;
    

  • 要完成初始化,请再次启动Firebird服务器.现在,您将可以执行网络登录数据库的操作, 包括安全数据库,使用您分配给的密码 SYSDBA.

  • To complete the initialization, start the Firebird server again. Now you will be able to perform a network login to databases, including the security database, using the password you assigned to SYSDBA.

    其中"SomethingCryptic"应为您的密码.

    Where 'SomethingCryptic', should be your password.

    如果创建了SYSDBA用户,则如果您忘记了设置的内容,则需要更改其密码.遵循相同的步骤,但是在第3步中:

    If a SYSDBA user was created, you will need to change its password if you no longer remember what you set. Follow the same steps, but in step 3 do:

    SQL> alter user SYSDBA set password '<new password>';
    SQL> commit;
    SQL> quit;
    

    如果出现错误找不到用户:SYSDBA的记录" ,请确保您确实以SYSDBA身份连接,否则请重试原始步骤3.没有管理员访问权限的行为将类似于用户不存在,因此如果该用户确实不存在,或者您与无特权的用户连接,则错误是相同的.

    If this gives an error "record not found for user: SYSDBA", make sure you are really connected as SYSDBA, otherwise retry the original step 3. Not having admin access will behave as if the user doesn't exist, so the error is the same if the user really doesn't exist, or if you are connected with an unprivileged user.

    这篇关于Firebird数据库SYSDBA连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆