reset password
Author Message
harminder91
Posts: 2
Posted 21:49 Apr 18, 2017 |

Hi All,

I am getting the error  " User cs3220stu40 already has more than 'max_user_connections' active connections" . I have closed the connection every time i have use in my servlet by implementing the c.close () in the try block at the end and also in the finally block. 

Any idea why this is happening?

Thank you

jdu12
Posts: 8
Posted 22:03 Apr 18, 2017 |

My version of this problem was that I forgot to put the c.close() in "finally", so whenever my program got error and stopped, the connection did not get to close, and then I ran out of connection allowance.

For your problem, i would suggest you to look for possible error time that left the connection open. and simply check if the c.close() gets to run.  

cysun
Posts: 2935
Posted 11:14 Apr 19, 2017 |

Each user can open at most 5 connections to the MySQL database on CS3 at the same time. Usually if you remember to close the connections in your code you won't run into this problem. What I noticed in the past was that some students opened multiple tab in MySQL Workbench to the server, and because each tab took up one connection, they ran out of connections for their code.

If you run into this problem, check your code and close extra tabs in MySQL Workbench. If the problem persists, inform me or the TAs.