Jump to content
xisto Community
lonelym

Too Many Connections? mysql_connect()

Recommended Posts

I uploaded my PHP game yesterday, and most of my friends tried it out. After a while, I tried to play as well but it said that mysql_connect() had too many connections already. Can anyone tell me how to increase the amount of connections or maybe the total amount of connections allowed?

Share this post


Link to post
Share on other sites

I uploaded my PHP game yesterday, and most of my friends tried it out. After a while, I tried to play as well but it said that mysql_connect() had too many connections already. Can anyone tell me how to increase the amount of connections or maybe the total amount of connections allowed?

You need to change the mysql.max_links directive and set it to -1, you can set this directive in your php.ini configuration file or in your apache's httpd.conf file.
Also, check out the MySql max_connections system variable, this variable controls the number of connections allowed that by default is 100. so if you need more connections, you should restart mysqld with a larger value for this variable.

If you are using MySql 5 take a look to B.1.2.6. Too many connections.

Best regards,

Share this post


Link to post
Share on other sites

It depends. I've seen some hosts that will allow their users to edit this setting. I would contact the webhost to see what can be done. If anything, they will/can increase it for you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.