Jump to content

My Sql Error Showing !! Issue with server or my php code?


Recommended Posts

Hi everyone..

 

Am getting these errors on my site periodically .. But sometimes in a refresh it will be ok...

 

What is the issue? Can any one help me to find a solution on it.. I contacted the server guys they told all are ok with them.. IS it something wrong with my code..

 

Thanks in advance..

 

Warning: mysql_connect() [function.mysql-connect]: Too many connections in D:\Hosting\4770399\html\admin\db_connect\config.php on line 2

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\4770399\html\admin\db_connect\config.php on line 3

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in D:\Hosting\4770399\html\admin\db_connect\config.php on line 3
Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\4770399\html\advt_dyna.php on line 3

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\Hosting\4770399\html\advt_dyna.php on line 3
Can't connect to MySQL server on 'localhost' (10061)

MySQL only allows so many connections to the database. That error implies that the max has been reached, so MySQL rejects the connection.

 

If you are on shared hosting, there isn't much you can do. You could always try mysql_pconnect() which creates a persistent connection, but that could also end up with the same error.

 

Do you use mysql_close() at the end of any of your pages? There shouldn't be a need as it's supposed to automatically close after the script execution, but you never know. I just read somewhere another person was able to stop the same connection error you are getting by implementing that.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.