DeveloperSide.NET Forums
December 12, 2019, 11:50:08 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: max_connections  (Read 15468 times)
0 Members and 1 Guest are viewing this topic.
invitro59
Jr. Member
**
Posts: 38


View Profile
« on: April 26, 2010, 03:00:43 PM »

Hi

For some reason max_connections did not give me any results in the forum search, anymay


I get more and more :

Quote
Warning: mysql_connect() [function.mysql-connect]: Too many connections in D:***********\includes\functions\database.php  on line 19
Unable to connect to database server!

or this :

Quote
Link to database cannot be established.

Depends on which system used for the website.

Si I thought I must have a limit or a default connection limit in apache or mysql, but now I do not know where should I change this setting

httpd.conf or vhost.conf ???
my.ini ???

What line to change ??? or add ???

How can you do so if maximum connections is reached that it tells a message online, but when trafic decreases everything comes back to normal instead of getting stuck with that stupid message that no usal person would understand.

Regards
Patrick
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: April 26, 2010, 03:53:36 PM »

http://dev.mysql.com/doc/refman/5.0/en/too-many-connections.html

You would edit my.ini and under the [mysqld] section, insert or modify line:
max_connections=100

100 is the default value.

Once this number is reached you get the mentioned message until that connection number goes down.

To handle the warning, you would have to code the php script to test for it and act appropriately (display a different message/page) (see user comments in the above link for examples).
« Last Edit: April 27, 2010, 05:32:55 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
invitro59
Jr. Member
**
Posts: 38


View Profile
« Reply #2 on: April 26, 2010, 04:08:21 PM »

Thanks for the quick reply (as usual).

I already changed the 100 to 200, found that line by using the controler edition (pretty easy to use this way)

I will check your link thank you.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!