Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Set up MySQL connection.
- var mysql = require("mysql");
- var connection = mysql.createConnection({
- port: 3306,
- host: "localhost",
- user: "root",
- password: "",
- database: ""
- });
- // Make connection.
- connection.connect(function(err) {
- if (err) {
- console.error("error connecting: " + err.stack);
- return;
- }
- console.log("connected as id " + connection.threadId);
- });
- // Export connection for our ORM to use.
- module.exports = connection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement