Good mornig to you guys.
(祝大家好。)
I want to establish a connection to a remote mysql database using node js.(我想使用节点js建立到远程mysql数据库的连接。)
but i am facing this error.(但是我正面临着这个错误。)
I do not know if I wrongly specifies the access path to the db(我不知道是否错误地指定了数据库的访问路径)
code (码)
var mysql = require('mysql');
var pool = mysql.createPool({
host: "http://kamerun-it.com/mysql",
connectionLimit : 100,
database: "****",
user: "****",
password: "*****",
multipleStatements: true
});
error (错误)
throw err;
^
Error: getaddrinfo ENOTFOUND http://kamerun-it.com/mysql at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26) -------------------- at Protocol._enqueue (F:\kamerun it\aspi-api\node_modules\mysql\lib\protocol\Protocol.js:144:48) at Protocol.handshake (F:\kamerun it\aspi-api\node_modules\mysql\lib\protocol\Protocol.js:51:23) at PoolConnection.connect (F:\kamerun it\aspi-api\node_modules\mysql\lib\Connection.js:119:18) at Pool.getConnection (F:\kamerun it\aspi-api\node_modules\mysql\lib\Pool.js:48:16) at Object.
(错误:GetaddrInfoReqWrap.onlookup上的getaddrinfo ENOTFOUND http://kamerun-it.com/mysql [完整完成](dns.js:60:26)------------------ -在Protocol._enqueue(F:\ kamerun it \ aspi-api \ node_modules \ mysql \ lib \ protocol \ Protocol.js:144:48)在Protocol.handshake(F:\ kamerun it \ aspi-api \ node_modules \在PoolConnection.connect(F:\ kamerun it \ aspi-api \ node_modules \ mysql \ lib \ Connection.js:119:18)在Pool.getConnection(F:的mysql \ lib \ protocol \ Protocol.js:51:23) \ kamerun it \ aspi-api \ node_modules \ mysql \ lib \ Pool.js:48:16)。)
(F:\kamerun it\aspi-api\app\model\db.js:16:8) at Module._compile (internal/modules/cjs/loader.js:956:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) at Module.load (internal/modules/cjs/loader.js:812:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:849:19) { errno: 'ENOTFOUND', code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: ' http://kamerun-it.com/mysql ', fatal: true }((F:\ kamerun it \ aspi-api \ app \ model \ db.js:16:8)位于Object.Module._extensions的Module._compile(internal / modules / cjs / loader.js:956:30)。在Function.Module._load(内部/模块/ cjs / loader)的Module.load(内部/模块/cjs/loader.js:812:32)的js(内部/模块/cjs/loader.js:973:10)。 js:724:14)在Module.require(internal / modules / cjs / loader.js:849:19){errno:'ENOTFOUND',代码:'ENOTFOUND',syscall:'getaddrinfo',主机名:' http:/ /kamerun-it.com/mysql ',致命:true})
ask by NGOUNE ALBAN translate from so