Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. { Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)
  2. at Handshake.Sequence._packetToError (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/sequences/Sequence.js:30:14)
  3. at Handshake.ErrorPacket (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/sequences/Handshake.js:67:18)
  4. at Protocol._parsePacket (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:197:24)
  5. at Parser.write (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Parser.js:62:12)
  6. at Protocol.write (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:37:16)
  7. at Socket.ondata (_stream_readable.js:555:20)
  8. at emitOne (events.js:101:20)
  9. at Socket.emit (events.js:188:7)
  10. at readableAddChunk (_stream_readable.js:176:18)
  11. at Socket.Readable.push (_stream_readable.js:134:10)
  12. --------------------
  13. at Protocol._enqueue (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:110:26)
  14. at Protocol.handshake (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/protocol/Protocol.js:42:41)
  15. at Connection.connect (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/Connection.js:81:18)
  16. at Connection._implyConnect (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/Connection.js:222:10)
  17. at Connection.query (/home/matthew/Node/mySqlTest/node_modules/mysql/lib/Connection.js:137:8)
  18. at Object.<anonymous> (/home/matthew/Node/mySqlTest/index.js:11:12)
  19. at Module._compile (module.js:570:32)
  20. at Object.Module._extensions..js (module.js:579:10)
  21. at Module.load (module.js:487:32)
  22. at tryModuleLoad (module.js:446:12)
  23. code: 'ER_ACCESS_DENIED_ERROR',
  24. errno: 1045,
  25. sqlState: '28000',
  26. fatal: true }
  27.  
  28. 'use strict';
  29.  
  30. var mysql = require('mysql');
  31.  
  32. var connection = mysql.createConnection({
  33. host: 'localhost',
  34. user: 'root',
  35. password: 'password'
  36. });
  37.  
  38. connection.query(
  39. 'SELECT "foo" AS first_field, "bar" AS second_field',
  40. function(err, results, fields) {
  41. console.log(err);
  42. console.log(results);
  43. connection.end();
  44. }
  45. );
  46.  
  47. GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password';
  48.  
  49. GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement