Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. // Set up MySQL connection.
  2. var mysql = require("mysql");
  3.  
  4. var connection = mysql.createConnection({
  5. port: 3306,
  6. host: "localhost",
  7. user: "root",
  8. password: "",
  9. database: ""
  10. });
  11.  
  12. // Make connection.
  13. connection.connect(function(err) {
  14. if (err) {
  15. console.error("error connecting: " + err.stack);
  16. return;
  17. }
  18. console.log("connected as id " + connection.threadId);
  19. });
  20.  
  21. // Export connection for our ORM to use.
  22. module.exports = connection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement