mysql error
Moderator: General Moderators
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
mysql error
hay when i try to connect with mysql_connect gets following error.
any solution. It was working fine yesterday but now giving error.
Error:
Too many connections
any solution. It was working fine yesterday but now giving error.
Error:
Too many connections
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
RAM is of 1 GB so i think it should not affect it.impulse() wrote:http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html
what's the proper way to close the mysql connection?
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
I am doing something like this:feyd wrote:mysql_close()
connection.php
Code: Select all
$link = mysql_connect("localhost","root","pass") or die(mysql_error());
mysql_select_db("ticket_chest",$link);Code: Select all
include "connection.php";
$qr = "my query";
$res = mysql_query($qr) or die(mysql_error());
while($row = mysql_fetch_array($res))
{
// Fetching values
}
mysql_close($link);too many connections
and when i restart the server it starts working fine.
and then after 20 hours i get this error again.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I can only guess that something or someone else is using up the connections pool. It may be a good idea to turn on logging.
Take a look here: http://dev.mysql.com/doc/refman/5.0/en/log-files.html
Take a look here: http://dev.mysql.com/doc/refman/5.0/en/log-files.html
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
can i solve it by making a new mysql user on database? will it work?feyd wrote:I can only guess that something or someone else is using up the connections pool. It may be a good idea to turn on logging.
Take a look here: http://dev.mysql.com/doc/refman/5.0/en/log-files.html
as you mentioned that may be someone esle is using this connection pool
I am using mysql 4.1.x
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Hmm.. I don't think so, but since I've not run into this issue myself, I can't say with authority.itsmani1 wrote:can i solve it by making a new mysql user on database? will it work?
http://dev.mysql.com/doc/refman/4.1/en/log-files.htmlitsmani1 wrote:I am using mysql 4.1.x
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
feyd wrote:Hmm.. I don't think so, but since I've not run into this issue myself, I can't say with authority.itsmani1 wrote:can i solve it by making a new mysql user on database? will it work?
http://dev.mysql.com/doc/refman/4.1/en/log-files.htmlitsmani1 wrote:I am using mysql 4.1.x
thank you,
some one suggested me to go for: mysql_pconnect()
will it make difference?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
yes it has made it worse.arborint wrote:It may, but will probably make it worse. You only need to type one character to try it so let us know. However, without knowing what the problems you will never really have a solution.itsmani1 wrote:some one suggested me to go for: mysql_pconnect()
will it make difference?
this is the error:
#1040 - Too many connections
One more thing: how can i find total available connections?
and
how can i find consumed connections and free connections?
I tried :
Code: Select all
mysql_stat($link)Uptime: 12075
Threads: 54
Questions: 638
Slow queries: 0
Opens: 20
Flush tables: 1
Open tables: 14
Queries per second avg: 0.053
thank you