Advertisement
Guest User

Untitled

a guest
May 11th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. var mysql = require("mysql");
  2.  
  3. // First you need to create a connection to the db
  4. var con = mysql.createConnection({
  5. host: "localhost",
  6. port: "3306",
  7. user: "root",
  8. password: "DIMbot%5452332",
  9. database : 'dimbotbd'
  10. });
  11.  
  12. con.connect(function(err){
  13. if(err){
  14. console.log('Error connecting to Db');
  15. return;
  16. }
  17. console.log('Connection established');
  18. });
  19.  
  20. con.end(function(err) {
  21. console.log('dasdasd');
  22. // The connection is terminated gracefully
  23. // Ensures all previously enqueued queries are still
  24. // before sending a COM_QUIT packet to the MySQL server.
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement