Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Connection lost: The server closed the connection. #5

Closed
ptcmariano opened this issue Apr 8, 2016 · 2 comments
Closed

Error: Connection lost: The server closed the connection. #5

ptcmariano opened this issue Apr 8, 2016 · 2 comments

Comments

@ptcmariano
Copy link

in 30 seconds after a request stops the server with error:
events.js:141
throw er; // Unhandled 'error' event
^

Error: Connection lost: The server closed the connection.
at Protocol.end (...\mysql-to-rest\node_modules\mysql\lib\protocol\Protocol.js:109:13)
at Socket. (...\mysql-to-rest\node_modules\mysql\lib\Connection.js:102:28)
at emitNone (events.js:72:20)
at Socket.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:893:12)
at doNTCallback2 (node.js:429:9)
at process._tickCallback (node.js:343:17)

can help me?

@kenodressel
Copy link
Owner

Well it looks like you have an issue with the db connection. This is an error that comes from the mysql package: "Connection lost: The server closed the connection."

@ptcmariano
Copy link
Author

I was using createConnection

var connection = mysql.createConnection({

And to not timeout crash the api, use

var connection = mysql.createPool({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants