[英]firebird - getaddrinfo ENOTFOUND
I am new to firebird database.我是火鸟数据库的新手。
I have created a database "a" and a table "STUDENT".我创建了一个数据库“a”和一个表“STUDENT”。
I am trying to connect to the database using this npm package https://www.npmjs.com/package/node-firebird我正在尝试使用此 npm 包https://www.npmjs.com/package/node-firebird连接到数据库
Following is my code to connect to db and get data.以下是我连接到数据库并获取数据的代码。
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();
});
});
});
I am using flameRobin.我正在使用flameRobin。 Following are my database properties
以下是我的数据库属性
I get following error in node console.我在节点控制台中收到以下错误。
{ [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 }
help me.帮帮我。
try :尝试:
options.host = '127.0.0.1'; or options.host = 'localhost';
instead of而不是
options.host = '127.0.0.1:c:\a.fdb';
and和
options.database = 'c:\a.fdb';
instead of而不是
options.database = 'a';
尝试localhost:c:\\a.fdb
作为您的主机和主机名
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.