我是firebird数据库的新手。
我已经创建了一个数据库"a“和一个表"STUDENT”。
我正在尝试使用这个npm包https://www.npmjs.com/package/node-firebird连接到数据库
下面是我连接到db并获取数据的代码。
var Firebird = require('node-firebird');
var options = {};
options.host = '127.0.0.1:c:\a.fdb';
options.port = 3050;
options.database = 'a';
options.user = 'SYSDBA';
options.password = 'sa123';
options.role = null; // default
options.pageSize = 4096; // default when creating database
app.get('/', function(request, response) {
Firebird.attach(options, function(err, db) {
if (err)
console.log(err);//her i get error
db.query('SELECT * FROM student', function(err, result) {
console.log(result);
db.detach();
});
});
});我正在使用flameRobin。以下是我的数据库属性

我在节点控制台中看到以下错误。
{ [Error: getaddrinfo ENOTFOUND 127.0.0.1:c:a.fdb 127.0.0.1:c:a.fdb:3050]
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: '127.0.0.1:c:a.fdb',
host: '127.0.0.1:c:a.fdb',
port: 3050 }帮帮我。
发布于 2016-09-11 15:47:51
尝试:
options.host = '127.0.0.1'; or options.host = 'localhost'; 而不是
options.host = '127.0.0.1:c:\a.fdb';和
options.database = 'c:\a.fdb'; 而不是
options.database = 'a';发布于 2016-09-11 11:12:29
尝试将localhost:c:\a.fdb作为主机和主机名
https://stackoverflow.com/questions/39429372
复制相似问题