I'm trying to connect a node server to my mysql database. I'm usually connecting with php, so the host is localhost
, but I don't know where to find the actual host for connecting.
This is what I'm using now:
var connection = mysql.createConnection({
host : 'hook.icnhost.net',
port : '2083',
user : 'user1_twitter',
password : 'twitter',
database : 'user1_twitter'
});
connection.connect(function(err){
if(!err) {
console.log("Database is connected ... nn");
} else {
throw err;
console.log("Error connecting database ... nn");
}
});
I got the host and port from the phpMyAdmin connection link.
Error:
Error: Packets out of order. Got: 80 Expected: 0
at Parser.write (D:\Projects\IntelligentWeb\node_modules\mysql\lib\protocol\Parser.js:41:19)
at Protocol.write (D:\Projects\IntelligentWeb\node_modules\mysql\lib\protocol\Protocol.js:39:16)
at Socket.<anonymous> (D:\Projects\IntelligentWeb\node_modules\mysql\lib\Connection.js:103:28)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
--------------------
at Protocol._enqueue (D:\Projects\IntelligentWeb\node_modules\mysql\lib\protocol\Protocol.js:141:48)
at Protocol.handshake (D:\Projects\IntelligentWeb\node_modules\mysql\lib\protocol\Protocol.js:52:41)
at Connection.connect (D:\Projects\IntelligentWeb\node_modules\mysql\lib\Connection.js:130:18)
at Object.<anonymous> (D:\Projects\IntelligentWeb\index.js:12:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
What does that error mean?
via Bogdan Daniel
No comments:
Post a Comment