Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mysql node

const mysql = require("mysql");
const mysqlDb = mysql.createConnection({
	host: process.env.mysql_HOST || "localhost",
	user: process.env.mysql_USER || "root",
	password: process.env.mysql_PASSWORD || "",
	database: process.env.mysql_DATABSE || "my_db"
});

mysqlDb.connect(err => {
	if(err) throw err;
});

module.exports = mysqlDb;
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #mysql #node
ADD COMMENT
Topic
Name
9+4 =