我正在尝试将我的脚本与 Firebird 中的数据库连接,但出现此错误。
这是我的代码,我正在尝试连接到我的本地数据库:
const Firebird = require('node-firebird');
var options = {};
options.host = '127.0.0.1';
options.port = 3050;
options.database = 'C:\\DATABASES\\PRUEBA.FDB';
options.user = 'SYSDBA';
options.password = 'password';
options.lowercase_keys = false; // set to true to lowercase keys
options.role = null; // default
options.pageSize = 4096;
Firebird.attach(options, (err, db) => {
if (err) console.log(err);
db.query('select * from temp', (err, response) => {
if (err) console.log(err);
console.log(response);
})
})
错误是这样的,但我不知道会发生什么:
Incompatible wire encryption levels requested on client and server
当您使用 Firebird 3 并且服务器或客户端需要有线加密,而另一端(通常是客户端)禁用有线加密时,会出现此错误 “客户端和服务器上请求的有线加密级别不兼容”。在这种情况下,您使用的是node-firebird,它不支持有线加密,并且始终将其报告为禁用:
blr.addBytes([CNCT_client_crypt, 4, WIRE_CRYPT_DISABLE, 0, 0, 0]); // WireCrypt = Disabled
另一方面,Firebird 3 的默认配置需要线路加密。为了进行连接,您需要将此设置从默认的 Required
放宽到
Enabled
(或
Disabled
,但这对于支持有线加密的应用程序来说不太安全)。您可以通过编辑服务器的
firebird.conf
并修改或添加来完成此操作:
WireCrypt = Enabled
然后重新启动您的 Firebird 服务器。如果您使用 Firebird 4.0 或更高版本,另请检查我的答案
错误:客户端和服务器上请求的线路加密级别不兼容 - 尝试使用 Firebird 4.0 连接节点服务器。