Hi I am trying to write an Node + Express to provide REST services. Everything goes well when the application starts. However, after several hours, I got an error: \"code\":
In my experience that problem was due to creating a connection directly (with mysqljs/mysql library, unsing createConnection()) instead of using createPool() that allows to run query() and releases the connection automatically after execution (doing getConnection() + query() + release()).
Without that the connection is not released and, at the next attempt to query, there happens the fatal error.
See Pooling Connections.