2016-09-10 3 views
2

파이어 버드 데이터베이스를 처음 사용했습니다.파이어 버드 - getaddrinfo ENOTFOUND

"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(); 
     }); 

    }); 
}); 

나는 불꽃 로빈을 사용하고 있습니다. 다음 내가 노드 콘솔에 오류가 다음 얻을

enter image description here

내 데이터베이스의 속성입니다.

{ [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 } 

나를 도와주세요.

+2

어떤 Firebird 버전을 사용하고 있습니까? Firebird 2.5 및 이전 버전은 IPv6 주소를 지원하지 않습니다. –

+0

Firebird 3.0을 사용 중입니다 –

+0

사용 권한과 관련이 있습니까? –

답변

2

는 호스트와 호스트 이름으로 localhost:c:\a.fdb을 시도

+0

다음 옵션을 시도했습니다 .host = 'localhost : c : \ a.fdb'성공하지 못했습니다. –

+0

기본 node.JS 앱이 포트에서 수신 대기 중입니까? – sova

+0

예. 그것은 듣고있다 –

4

시도 : 대신

options.host = '127.0.0.1:c:\a.fdb'; 

options.database = 'c:\a.fdb'; 

대신

0123의

options.host = '127.0.0.1'; or options.host = 'localhost'; 

options.database = 'a'; 
+0

아니요. 일하지 않았어. options.host = '로컬 호스트'; options.database = 'd : \\ a.fdb'; options.user = 'sysdba'; options.password = 'sa123'; 이번에는 "[Connection is Closed]"오류 –

+0

'options.database = 'd : \\ a.fdb''? 이 tipo 아니면 ...? 'options.database = 'd : \ a.fdb''를 의미합니까? –

+0

오타가 없습니다. 왜냐하면 '\'(단일 \)는 이스케이프 시퀀스로 간주되기 때문입니다. –