Answer the question
In order to leave comments, you need to log in
Why can't connect to mysql?
I installed the mysql package, did everything according to the instructions, but
const http = require('http');
const mysql = require("mysql");
const connection = mysql.createConnection({
host : "localhost",
user : "root",
password : "password"
});
connection.connect(function(e) {
if(!!e) {
console.log(e);
}
else {
console.log("Connected");
}
});
http.createServer(function (req, res) {
res.write('Hello World!');
res.end();
}).listen(8080);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question