MySQL question, of time out variables and connections.

I’m having a hard time understanding how these variables work. If I set max_connections at 100 and click the run query button in MySQL Control Center (something simple like Select * from Customers) 101 times I get “Too many connections”. But if I set wait_timeout to 30, run the query then wait 35 seconds and run it again, I get “Lost connection to MySQL database”. So which is it? Am I getting a new connection each time I go to the database or is it trying to use the same connection each time? To me, it appears to try the one that will fail :slight_smile:

Help?

You did remember to close your connection right?

Forget the code, this is just running simple queries from Control Center.

But to answer your question, yes, in the code I am closing them when I am done :slight_smile:

This is just a guess, but it’s possible that the control center does some sort of handshake after the query, and doing another query too quickly will spawn off another thread to handle that one, consequently opening a new connection. Try doing 100 queries, waiting 20 seconds, and then doing another query.