Closed ken92 closed 10 years ago
Remove socketPath
; you only use that to connect using a UNIX socket on the same machine.
When I remove socketPath, I get this error:
Error: connect EACCES
at errnoException (net.js:901:11)
at Object.afterConnect [as oncomplete] (net.js:892:19)
--------------------
at Protocol._enqueue (C:\Users\Eridan\Desktop\CEMS-test\node_modules\mysql\lib\protocol\Protocol.js:110:48)
at Protocol.handshake (C:\Users\Eridan\Desktop\CEMS-test\node_modules\mysql\lib\protocol\Protocol.js:42:41)
at Connection.connect (C:\Users\Eridan\Desktop\CEMS-test\node_modules\mysql\lib\Connection.js:101:18)
at Object.<anonymous> (C:\Users\Eridan\Desktop\CEMS-test\test.js:9:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
What does this error mean?
It means your Windows firewall blocked the outgoing TCP connection.
Try running your node script in an elevated (Administrator) command prompt to see if it helps.
Allowing Node-Webkit through my firewall fixed it. Thanks!
I've copied the sample code for connecting to the MySQL database into a .js file (making modifications to connect to my server, of course) and it gives this error (with the paths edited for brevity):
Here's the code:
The socketPath was found by running "locate mysql | grep .sock" Also, I'm running the code on a Windows machine while the database is on Linux. I'm not sure if that makes a difference, but there you go.
I've been Googling this all day and haven't made any headway, so if anyone could point me in the right direction, I'd really appreciate it.