Answered by:
MySql max_connection issues

Question
-
User-1035692366 posted
Hi all
I have been using MySql Workbench in the past few weeks after i convert Mssql to MySql
I noticed this strange error that pops out everytime when i was trying my asp website
It keep prompting 'Too many connections' when i tend to navigate across my web pages
After i uploaded it into a web hosting site, it still shows me that error 'max_connection .....'
I have checked all my web pages and i always have a habit to close all my MySql connections
So why am i having this error? Can anyone enlighten me or teach me any method that will be useful to counter this problem?
Wednesday, August 28, 2013 5:17 AM
Answers
-
User-1035692366 posted
I guess that I have solved this problem by editing my connection Strings...I added Pooling = False to my connection strings and i guess its working
Haven't got any error ever since i added that code
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, August 29, 2013 5:43 AM
All replies
-
User-861818263 posted
Play with Max Pool Size or simillar properties in connection string may help you
initial catalog=Northwind; Data Source=localhost; Connection Timeout=30;
User Id=MYUSER; Password=PASSWORD; Min Pool Size=20; Max Pool Size=200; "Wednesday, August 28, 2013 5:26 AM -
User-837620913 posted
If it is just you navigating through the site and you are getting max_connection errors, then there is a leak somewhere.
Check to make sure you are disposing of all objects that implement IDisposable. Some vendors don't cleanup the connection if you don't dispose of everything including the SqlCommand, SqlConnection, SqlAdapter etc. I noticed that despite disposing of all my Oracle connections that we had hanging connections. I had to dispose of the Command, DataAdapter, and Connection before the connection was released.
Wednesday, August 28, 2013 5:30 AM -
User13850534 posted
Means you hosting provider has set the max connection limits in my.ini file. If you're sure everything is closed after database connection. then you might check with your provider about how many connections allowed there.
Thursday, August 29, 2013 12:28 AM -
User-1035692366 posted
Hi Darrell
Thanks for replying. I don't quite understand about 'Check to make sure you are disposing of all objects that implement IDisposable. Some vendors don't cleanup the connection if you don't dispose of everything including the SqlCommand, SqlConnection, SqlAdapter etc. I noticed that despite disposing of all my Oracle connections that we had hanging connections. I had to dispose of the Command, DataAdapter, and Connection before the connection was released.' part.
Does it mean that i must close the commands,adapters all that before closing the sqlconnection? I am using MySql by the way. Had no such problems with mssql before
Thursday, August 29, 2013 2:40 AM -
User-1035692366 posted
Hi Topspy
About the connections i have made adjustments myself like the following codes
set global max_connections = 100000;
So when i check whats my max connections it is capped at 100000
But everytime i try to navigate my website on the server itself it tends to give me too many connections error
I got that sometimes in localhost too
Thursday, August 29, 2013 2:42 AM -
User-1035692366 posted
I guess that I have solved this problem by editing my connection Strings...I added Pooling = False to my connection strings and i guess its working
Haven't got any error ever since i added that code
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, August 29, 2013 5:43 AM