Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eBJJjW612600 for ; Tue, 19 Dec 2000 14:45:32 -0500 (EST) (envelope-from pgsql-admin-owner@postgresql.org) Received: from sitewarehouse1.sitewarehouse.net ([204.138.56.2]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBJJ0C607734; Tue, 19 Dec 2000 14:00:12 -0500 (EST) (envelope-from joseph@sitewarehouse.net) Received: from swnt3 (H163.C59.tor.velocet.net [204.138.59.163]) by sitewarehouse1.sitewarehouse.net (8.9.3/8.9.3) with SMTP id OAA23319; Tue, 19 Dec 2000 14:00:12 -0500 Message-ID: <006101c069ee$227ffd00$a33b8acc@sitedom> From: "Joseph" To: , , Subject: help Date: Tue, 19 Dec 2000 14:01:46 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005E_01C069C4.39900460" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200012/123 X-Sequence-Number: 319 This is a multi-part message in MIME format. ------=_NextPart_000_005E_01C069C4.39900460 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Help me for "DBI->connect failed: Sorry, too many clients already." my cgi program is test.cgi: ####################### require "./connectdb.pl"; &connectdatabase(); $query=3D"select count(*) from messages"; $sth=3D$dbh->prepare($query); $sth->execute(); $count=3D$sth->fetchrow_array(); print "Content-type: text/html\n\n"; print <<"TAG";

The count is $count.

TAG exit 0; ############# my connectdb.pl : sub connectdatabase { # my ($dbusername,$dbpassword)=3D@_; $dbusername=3D"postgres"; $dbpassword=3D"lokicom"; $dbname=3D"mboardsony"; use DBI; $dbh=3DDBI->connect("dbi:Pg:dbname=3D$dbname",$dbusername,$dbpassword) or= die "can not connect to $dbname\n"; } 1; ####################### my os is Redhat 6.2,and perl 5.005,and web server is Apache. The problem is:when I run test.cgi,it can work properly.But when I press F5 to refresh the web page for sever minutes,the Apache will have error messag= e: "DBI->connect failed: Sorry, too many clients already." Who can help me? Thank you ahead. =20=20 My email: joel_xue@hotmail.com ------=_NextPart_000_005E_01C069C4.39900460 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Help me for "DBI->connect failed: Sorry= , too=20 many clients already."
my cgi program is=20 test.cgi:
#######################
require=20 "./connectdb.pl";
&connectdatabase();
$query=3D"select count(*) f= rom=20 messages";
$sth=3D$dbh->prepare($query);
$sth->execute();
$c= ount=3D$sth->fetchrow_array();
print=20 "Content-type: text/html\n\n";
print=20 <<"TAG";
<html>
<body>
<h2> The count is= =20 $count. </h2>
</body>
</html>
TAG
exit=20 0;
#############
my connectdb.pl :
sub connectdatabase {
# = ; my=20 ($dbusername,$dbpassword)=3D@_;
  $dbusername=3D"postgres";
&nbs= p;=20 $dbpassword=3D"lokicom";
  $dbname=3D"mboardsony";
  use=20 DBI;
 =20 $dbh=3DDBI->connect("dbi:Pg:dbname=3D$dbname",$dbusername,$dbpassword) o= r die=20 "can
not connect to $dbname\n";
}
1;
#######################my=20 os is Redhat 6.2,and perl 5.005,and  web server is Apache.
The prob= lem=20 is:when I run test.cgi,it can work properly.But when I press F5
to refre= sh=20 the web page for sever minutes,the Apache will have error=20 message:
"DBI->connect failed: Sorry, too many clients already."
&= nbsp;=20 Who can help me?
  Thank you ahead.
 
  My email: = joel_xue@hotmail.com
<= /BODY> ------=_NextPart_000_005E_01C069C4.39900460--