I was trying to connect nodejs with mysql(first time).i am following w3schools.
Before running the below code i have installed ('npm install mysql').And the website mentioned ou can download a free MySQL database and Once you have MySQL up and running on your computer, you can access it by using Node.js.
i have installed mysql ,but how to start and run it in windows,please help.
var con =mysql.createConnection({
host:"localhost",
user:"root",
password:" "
});
con.connect(function(err) {
if(err) {
console.log("Error")
}
else
console.log("Connected!");
});
question from:
https://stackoverflow.com/questions/65860182/connecting-nodejs-with-mysql 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…