'max_user_connections' resource ERROR

Discussion in 'Databases' started by kath1609, Sep 8, 2012.

  1. 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.
     
  2. ComputerMan

    ComputerMan Winhost Staff

    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
     
  3. 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


    :(
     
  4. I'm closing the connection using conn.Close(), and I'm also doing this to the rest of my webpages. :(
     
  5. it doesn't work... I use conn.Close() but there are still SLEEPING connections....
     
  6. ComputerMan

    ComputerMan Winhost Staff

  7. max_user_connections

    Hi kath1609,

    Did you ever get this to work?
     
  8. Elshadriel

    Elshadriel Winhost Staff

Share This Page