Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. function getConnection ()
  2. {
  3. const options =
  4. {
  5. host: "111.11.11.11", //IP address of my Cloud SQL Server
  6. user: 'root',
  7. password: 'somePassword',
  8. database: 'DatabaseName'
  9. };
  10. return mysql.createConnection(options);
  11. }
  12.  
  13. function getConnection ()
  14. {
  15. const options =
  16. {
  17. user: 'root',
  18. password: 'somePassword',
  19. database: 'DatabaseName',
  20. socketPath: '/cloudsql/project-name-123456:europe-west1:sql-instance-name'
  21. };
  22. return mysql.createConnection(options);
  23. }
  24.  
  25. { [Error: connect ENOENT /cloudsql/project-name-123456:europe-west1:sql-instance-name]
  26. code: 'ENOENT',
  27. errno: 'ENOENT',
  28. syscall: 'connect',
  29. address: 'cloudsql/project-name-123456:europe-west1:sql-instance-name',
  30. fatal: true }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement