Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. var mysql = require('mysql');
  2.  
  3. var connection = mysql.createConnection({
  4. host : 'localhost',
  5. user : 'root',
  6. password : 'root',
  7. database : 'dbname',
  8. port: '8889'
  9. });
  10.  
  11. connection.connect(function(err) {
  12. if (err) {
  13. console.log("Error connecting to DB: " + err);
  14. throw err;
  15. }
  16. });
  17.  
  18. TypeError: Cannot read property 'on' of undefined
  19. at Protocol._enqueue (/Applications/MAMP/htdocs/Angular2/myproject/node_modules/mysql/lib/protocol/Protocol.js:152:5)
  20. ...
  21.  
  22. Error connecting to DB: Error: Connection lost: The server closed the connection.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement