2
am connecting mysql with Node but is giving this error:
C:\E. S\dao.js:10 if (err) throw err ^ Error: getaddrinfo ENOTFOUND localhost:806 localhost:806:3306 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26) -------------------- at Protocol._enqueue (C:\E. S\node_modules\mysql\lib\protocol\Protocol.js:144:48) at Protocol.handshake (C:\E. S\node_modules\mysql\lib\protocol\Protocol.js:51:23) at Connection.connect (C:\E. S\node_modules\mysql\lib\Connection.js:119:18) at Object.<anonymous> (C:\E. S\dao.js:9:5) at Module._compile (internal/modules/cjs/loader.js:805:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10) at Module.load (internal/modules/cjs/loader.js:672:32) at tryModuleLoad (internal/modules/cjs/loader.js:612:12) at Function.Module._load (internal/modules/cjs/loader.js:604:3) at Function.Module.runMain (internal/modules/cjs/loader.js:868:12)
I took the code from this site: https://www.w3schools.com/nodejs/nodejs_mysql.asp
the code:
var mysql = require('mysql');
var con = mysql.createConnection({
host: "localhost:806",
user: "root",
password: "usbw"
});
con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
});
You can check if the door is actually 806 ?
– Lucas Brogni
Samuel, change the host port to see if it accesses:
host: "localhost:3306",
– Rodrigo Tognin
so I just saw here my door is 3307, obg whatever thing you update the question with possible new bugs, obg
– Samuel Silva