[英]Connection Error to Firebird DB
I have attached my code and error message on the below.我在下面附上了我的代码和错误消息。 Can you please help me, I could not find the reason to get the error.
你能帮我吗,我找不到错误的原因。 Thanks,
谢谢,
// My Code // 我的代码
// Node-Firebird
var Firebird = require('node-firebird');
// Options
var options = {};
//options.host = '127.0.0.1';
//options.port = 3050;
options.database = 'mydb.FDB';
options.user = 'SYSDBA';
options.password = 'masterkey';
// Query
Firebird.attach(options, function(err, db) {
if (err)
throw err;
// db = DATABASE
db.query('SOME QUERY', function(err, result) {
// IMPORTANT: close the connection
db.detach();
});
});
// Error Message // 错误信息
/Users/bla/myfile.js:14 throw err;
/Users/bla/myfile.js:14 抛出错误; ^ Error: I/O error during "open" operation for file "/Users/bla/mydb.FDB", Error while trying to open file at doCallback (/Users/bla/node_modules/node-firebird/lib/index.js:1233:18) at /Users/bla/node_modules/node-firebird/lib/index.js:2897:21 at /Users/bla/node_modules/node-firebird/lib/messages.js:151:25 at search (/Users/bla/node_modules/node-firebird/lib/messages.js:117:13) at /Users/bla/node_modules/node-firebird/lib/messages.js:54:21 at FSReqWrap.wrapper as oncomplete
^ 错误:文件“/Users/bla/mydb.FDB”的“打开”操作期间的 I/O 错误,尝试在 doCallback 中打开文件时出错 (/Users/bla/node_modules/node-firebird/lib/index.js :1233:18) 在 /Users/bla/node_modules/node-firebird/lib/index.js:2897:21 在 /Users/bla/node_modules/node-firebird/lib/messages.js:151:25 在搜索( /Users/bla/node_modules/node-firebird/lib/messages.js:117:13) 在 /Users/bla/node_modules/node-firebird/lib/messages.js:54:21 在 FSReqWrap.wrapper 作为 oncomplete
NOTE: Actually, I can connect the same database with c++ based driver:注意:实际上,我可以使用基于 c++ 的驱动程序连接同一个数据库:
var fb = require("firebird");
var con = fb.createConnection();
con.connectSync('mydb.FDB', 'SYSDBA', 'masterkey', '');
var rs = con.querySync('SOME QUERY');
And when I am trying to connect via Flamerobin, it works perfectly as well.当我尝试通过 Flamerobin 进行连接时,它也能完美运行。 This is really weird error I guess.
我猜这真的是很奇怪的错误。 Any other suggestions, please?
请问还有什么建议吗?
I don't know the node-firebird driver, but given the behavior, one might be connecting locally (with the client library acting as a server), while the other connects through the server.我不知道 node-firebird 驱动程序,但鉴于行为,一个可能在本地连接(客户端库充当服务器),而另一个通过服务器连接。 This could potentially lead to the following problems:
这可能会导致以下问题:
/Users/bla/mydb.FDB
doesn't exist/Users/bla/mydb.FDB
不存在/Users/bla/mydb.FDB
in the error suggests it is a database in a user folder which means that it is not accessible to the Firebird server process (which usually runs under the user firebird
)./Users/bla/mydb.FDB
表明它是用户文件夹中的数据库,这意味着 Firebird 服务器进程(通常在用户firebird
下运行)无法访问它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.