This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

SQL too many connections error when trying to load forms


  1. seangritzman
    Member

    We noticed over a two day time period an error stating "too many connections" when trying to load a form. I wish I would have captured the full message however I did not. I contacted my hosting provider and they responded with the below message. Is there something we need to do in order to prevent this from happening again? An example of one of our forms can be found here: http://www.topflightvbc.com/registration/regformtryouts.php

    ********************
    The error you are experiencing with your database is due to too many active connections to your MySQL database. If you are using mysql_pconnect(), this type of connection never closes. It is a persistent connection that stays open for later use. This can easily cause you to have too many active connections depending on how many people visit the website. I suggest you change it to mysql_connect() instead if you are using this. If you are using mysql_connect(), you may not be closing the database connection at the end of a query, please check that all connections are closed after use. Otherwise, you may be hitting the maximum concurrent connections due to traffic volume.
    *********************

    Posted 12 years ago #
  2. yuniar

    MachForm doesn't use any persistent connections, so there is no need to modify any code. Are you on a shared hosting or a dedicated server?

    If you are on a shared hosting, most likely you are having a spike of traffic, try to check into your website statistic. If you don't find any increased traffic, then most likely there are other users within the same server is using too many connections to the database, hence eating up the allocation on the server.


    MachForm Founder

    Posted 12 years ago #
  3. seangritzman
    Member

    yuniar... these are the messages we are getting when trying to use any of our registration forms:

    Error connecting to the database: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '(took out ip address)' (4)

    Error connecting to the database: SQLSTATE[HY000] [1040] Too many connections

    My hosting provider is Network Solutions and in the past we have never had a problem and unfortunately this is the critical time of the year for this to be working. We have been up and down for the past 6 days with no solution in sight.

    Do you by chance have any thoughts which might help? If not with your product then maybe something I can ask of my provider?

    Posted 12 years ago #
  4. seangritzman
    Member

    Also getting this error as well:

    500: Internal server error
    This error is generated when a script running on the server could not be implemented or permissions are incorrectly assigned for files or directories
    Troubleshooting suggestions:
    Temporarily disable any rewrite rules by renaming your .htaccess file if it exists.
    Ensure that any CGI or Perl scripts have at least .755. permissions.
    If trying to run PHP and you get this error, you may have an invalid php.ini in your /cgi-bin, or may be missing your php.dat file in this folder.

    Posted 12 years ago #
  5. yuniar

    Hi Sean,

    I'm afraid not much we can do from the script side if the error message is "SQLSTATE[HY000] [1040] Too many connections", since this is an issue with the MySQL server.

    As your hosting tech support said "you may be hitting the maximum concurrent connections due to traffic volume.", either by your site or another site which is located on the same server. You might want to ask your hosting tech support to migrate your database to another server or upgrading to their higher plan.


    MachForm Founder

    Posted 12 years ago #
  6. yuniar

    Hi Sean,

    I'm afraid not much we can do from the script side if the error message is "SQLSTATE[HY000] [1040] Too many connections", since this is an issue with the MySQL server.

    As your hosting tech support said "you may be hitting the maximum concurrent connections due to traffic volume.", either by your site or another site which is located on the same server. You might want to ask your hosting tech support to migrate your database to another server or upgrading to their higher plan.


    MachForm Founder

    Posted 12 years ago #

RSS feed for this topic

Reply