< Buzzing or vibrating the login form using jquery Posted On May 15, 2012 : 0 comments << >> Simple div slideshow using jquery Posted On May 9, 2012 : 0 comments << >> Copy mysql column in varchar to type date Posted On May 3, 2012 : 0 comments << >> Enter only numbers inside a input field of a form using javascript Posted On May 1, 2012 : 0 comments << >> Slide in and out animate div vertically using jquery Posted On April 25, 2012 : 1 comment << >> Tag cloud using php, mysql and ajax with filter Posted On April 24, 2012 : 0 comments << >> Change webpage font color or background color from the user side using javascript Posted On April 19, 2012 : 0 comments << >> A single link that cycles through several webpage background color using javascript Posted On April 17, 2012 : 0 comments << >> Simple webpage redirection using perl script Posted On April 10, 2012 : 0 comments << >> Get ipaddress using perl script Posted On April 4, 2012 : 0 comments << >>

Fix Too many connections mysql_connect

This Tutorial Has Been Viewed 4,545 Times.
VN:F [1.9.17_1161]
Rating: 9.0/10 (4 votes cast)

If you get a Too many connections error when you try to connect to the mysq server, then it clearly means that all available connections are in use.
Too Many Connections can be caused by either a lot of simultaneous connections or by old connections not being released properly.
Factors affecting the connection of MySQL
1)mysql_pconnect()
2)mysql_connect()
3)mysqladmin flush-hosts


Along with these parameters you can also check the existing process list run this command as root

 mysqladmin -u <user> -p<password> processlist

mysql_pconnect(), This creates a permanent connection to the database (permanent is defined as 8 hours by the MySQL wait_timeout system variable). It will only create a new connection if it cannot find an existing permanent connection to reuse. You need to be careful with mysql_pconnect() to make sure that you don’t run out of connections, since these stay open so long and you cannot close them with mysql_close().

mysql_connect(), This can be better than mysql_pconnect() because these connections can be short lived, and can be closed when needed with mysql_close(). An important parameter is the CLIENT_INTERACTIVE flag. If this is passed, it will use the MySQL interactive_timeout value instead of wait_timeout. Sincewait_timeout defaults to 8 hours, this seems like a great idea. However, surprisingly,interactive_timeout also defaults to 8 hours. You should change this value to something smaller that fits your system.

mysqladmin flush-hosts, That command drops dead connections.

You can also use this command when you experience these type of errors
Host ‘host_name’ is blocked because of many connection errors.
Unblock with ‘mysqladmin flush-hosts’

Solution:

As root, run the command:

mysqladmin flush-hosts

VN:F [1.9.17_1161]
Rating: 9.0/10 (4 votes cast)

Fix Too many connections mysql_connect, 9.0 out of 10 based on 4 ratings

Incoming search terms:





You will also be interested in ,

Tags: ,

Leave a Reply

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks