使用 ADO.Net 提供程序将 Firebird 2.5 迁移到 4.0 [英] Migrate Firebird 2.5 to 4.0 using ADO.Net provider
问题描述
我刚刚将我的数据库升级到 Firebird 4.0,在使用数据库管理工具连接到数据库时,一切似乎都可以正常工作.
所以现在我尝试连接,在确保我已将 ADO.Net 升级到 FirebirdSql.Data.FirebirdClient v8.0.1(最新)之后.
这是我创建连接字符串的方法(是的,数据库路径存在并且我确保用户具有修改权限):
FbConnectionStringBuilder cs = new FbConnectionStringBuilder();cs.Database = @C:/myPath/MyDB.FDB";cs.DataSource = 本地主机";cs.UserID = "sysdba";cs.Password = "masterkey";cs.方言= 3;cs.Pooling = false;cs.ServerType = FbServerType.Default;//--- 首先省略 - 3 种类型中的任何一种都会导致错误!//cs.WireCrypt = FbWireCrypt.Disabled;var DBConn = new FbConnection(cs.ConnectionString);DBConn.Open();
现在,请注意我遗漏了 WireCrypt
选项(有意开始).我的错误是:
登录时出错,详情请查看服务器firebird.log
firebird.log
说:
身份验证错误服务器上没有匹配的插件
所以我搜索了一下,找到了提示 它可能来自有线加密.好吧,所以我确实尝试了所有 3 个版本的有线加密 - 如果我使用 Required
或 Enabled
,我会收到上述错误.如果我使用 Disabled
,我得到
客户端和服务器请求的有线加密级别不兼容
此外,我尝试在 firebird.conf
和我的代码中设置 WireCrypt = Disabled
,重新启动服务并再次测试 - 现在我得到了与前两种情况:
身份验证错误服务器上没有匹配的插件
所以我想我在这里遗漏了一些关于加密插件的信息 - 但我在那里找不到任何有价值的信息,感谢您的帮助!
更新:这是我尝试过的设置和我得到的错误:
尝试 1: 所有 firebird.conf
默认值(我发布了它 此处 以保持简短):
连接字符串 1:
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Disabled
<块引用>
客户端和服务器请求的有线加密级别不兼容
连接字符串 2(wire crypt=Enabled 或 Required)
<块引用>身份验证错误服务器上没有匹配的插件
尝试 2:
WireCrypt = 禁用
连接字符串 1:
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Disabled
<块引用>
身份验证错误服务器上没有匹配的插件
连接字符串 2 (wire crypt=Enabled) =>同样的错误!
尝试 3:
AuthClient = Srp256, Srp用户管理器 = Srp
连接字符串 1:
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Disabled
<块引用>
客户端和服务器请求的有线加密级别不兼容
连接字符串 2(wire crypt=Enabled 或 Required)
<块引用>身份验证错误服务器上没有匹配的插件
尝试 4:
AuthClient = Srp256, Srp用户管理器 = SrpWireCryptPlugin = ChaCha, Arc4WireCrypt = 启用服务器模式 = 超级
连接字符串(与连接字符串中的任何 wire crypt 选项结果相同):
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Enabled
<块引用>
身份验证错误服务器上没有匹配的插件
注意:我在firebird.log
中也看到了以下消息,可能是服务重启造成的...
inet_error: read errno = 10054, client host = DESKTOP-1234, address = 127.0.0.1/60348, user = myusername
好的,我最终使用以下设置让它工作:
firbird.conf
:
AuthServer = Srp256,Srp用户管理器 = SrpWireCrypt = 启用
和连接字符串代码:
FbConnectionStringBuilder bld = new FbConnectionStringBuilder();bld.Charset = "NONE";bld.DataSource = "localhost";bld.Database = @C:\Users\DBAccess\MYDB.FDB";bld.UserID = "SYSDBA";bld.Password = "masterkey";bld.WireCrypt = FbWireCrypt.Enabled;字符串 connStr = bld.ConnectionString;
I just upgraded my DB to Firebird 4.0 and all seems to work when connecting to the DB using a database management tool.
So now I try to connect, after making sure I've upgarded my ADO.Net to FirebirdSql.Data.FirebirdClient v8.0.1 (latest).
Here is how I create my connection string (yes, db path exists and I made sure that users have modification rights):
FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
cs.Database = @"C:/myPath/MyDB.FDB";
cs.DataSource = "localhost";
cs.UserID = "sysdba";
cs.Password = "masterkey";
cs.Dialect = 3;
cs.Pooling = false;
cs.ServerType = FbServerType.Default;
// --- Omitted at first - any of the 3 types leads to errors!
//cs.WireCrypt = FbWireCrypt.Disabled;
var DBConn = new FbConnection(cs.ConnectionString);
DBConn.Open();
Now, notice I left out WireCrypt
option (on purpose to start with). My error is:
Error occurred during login, please check server firebird.log for details
firebird.log
says:
Authentication error No matching plugins on server
So I googled around and found hints it may come from wire encryption. Well ok, so I did try all 3 versions of wire encryption - if I use Required
or Enabled
, I get the above error. If I use the Disabled
, I get
Incompatible wire encryption levels requested on client and server
Furthermore, I tried setting WireCrypt = Disabled
in firebird.conf
and in my code, restarted the service and tested again - now I have the same result as with the first two cases:
Authentication error No matching plugins on server
So I guess I'm missing something here about the encryption plugins - but I couldn't find any valuable information there, thanks for helping out!
UPDATE: here are the settings I tried and the error I got:
Attempt 1: all firebird.conf
defaults (I posted it here to keep things short here):
Connection string 1:
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Disabled
Incompatible wire encryption levels requested on client and server
Connection string 2 (wire crypt=Enabled or Required)
Authentication error No matching plugins on server
Attempt 2:
WireCrypt = Disabled
Connection string 1:
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Disabled
Authentication error No matching plugins on server
Connection string 2 (wire crypt=Enabled) => same error!
Attempt 3:
AuthClient = Srp256, Srp
UserManager = Srp
Connection string 1:
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Disabled
Incompatible wire encryption levels requested on client and server
Connection string 2 (wire crypt=Enabled or Required)
Authentication error No matching plugins on server
Attempt 4:
AuthClient = Srp256, Srp
UserManager = Srp
WireCryptPlugin = ChaCha, Arc4
WireCrypt = Enabled
ServerMode = Super
Connection string (same result with any wire crypt option in the connection string):
character set=NONE;data source=localhost;initial catalog=C:\Users\DBAccess\MYDB.FDB;user id=SYSDBA;password=masterkey;wire crypt=Enabled
Authentication error No matching plugins on server
NOTE: I also see the following message in firebird.log
, which is possibly due to the service restart...
inet_error: read errno = 10054, client host = DESKTOP-1234, address = 127.0.0.1/60348, user = myusername
Ok, I eventually got it to work using following settings:
firbird.conf
:
AuthServer = Srp256,Srp
UserManager = Srp
WireCrypt = Enabled
And connection string code:
FbConnectionStringBuilder bld = new FbConnectionStringBuilder();
bld.Charset = "NONE";
bld.DataSource = "localhost";
bld.Database = @"C:\Users\DBAccess\MYDB.FDB";
bld.UserID = "SYSDBA";
bld.Password = "masterkey";
bld.WireCrypt = FbWireCrypt.Enabled;
string connStr = bld.ConnectionString;
这篇关于使用 ADO.Net 提供程序将 Firebird 2.5 迁移到 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!