Hi to all, I already published my website and it works fine. I can access all webpages, but after almost an hour, it gives me an error. Here's the detail. Server Error in '/' Application. ERROR [HY000] [MySQL][ODBC 5.1 Driver]User 'ecoparkuser' has exceeded the 'max_user_connections' resource (current value: 25) ERROR [HY000] [MySQL][ODBC 5.1 Driver]User 'ecoparkuser' has exceeded the 'max_user_connections' resource (current value: 25) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000] [MySQL][ODBC 5.1 Driver]User 'ecoparkuser' has exceeded the 'max_user_connections' resource (current value: 25) ERROR [HY000] [MySQL][ODBC 5.1 Driver]User 'ecoparkuser' has exceeded the 'max_user_connections' resource (current value: 25) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. --> I think it has something to do with granting privileges to ecoparkuser, but I'm not really sure about that. How can I resolve this? by the way, after an hour, my website runs smoothly, but I don't want this error to happen again after an hour of browsing my website so please help me to resolve this. Another thing, I'm using MySql Workbench to manipulate my database.
The MySQL User is hitting the connection limit on the MySQL database. You need to code your site to close the connection to the MySQL database after each time the connection is made or else this problem will come up. It clears after an hour because of the wait timeout period. After one hour of being connected to the MySQL database. The connection will be automatically closed. You might find the following web page articles helpful here: http://php.net/manual/en/function.mysql-close.php http://php.about.com/od/phpfunctions/qt/mysql_close.htm
Hmmn,, but I'm always closing the database connection after each time the connection is made.. here's my code: My Connection: Dim connStr As String = ConfigurationManager.ConnectionStrings("conn").ConnectionString Dim conn As New OdbcConnection(connStr) here's my vb codes from one of my webpages... Private Sub FAC_REC() Dim comm As New OdbcCommand : Dim dr As OdbcDataReader conn.Open() : comm.Connection = conn comm.CommandText = "call callFacility()" dr = comm.ExecuteReader While dr.Read fac = (dr(1)) & "|" : img = (dr(2)) & "|" : desc = (dr(3)) & "|" homeRec.Add(fac & img & desc) End While comm.Dispose() dr = Nothing conn.Close() ' I'M CLOSING THE CONNECTION... End Sub
I wonder if this forum post here: http://www.vbforums.com/showthread.php?566006 might be able to help you out. The forum post above refers to a web page article here: http://www.primaryobjects.com/CMS/Article69.aspx It shows you how to kill a sleeping connection after a certain amount of time. I hope this helps you out
Try putting the conn.Close() statement before the comm.Dispose() method. I'm not even sure why you need to invoke the Dispose() method. You only need to use it when you have unmanaged code... http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx