pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph <joseph@sitewarehouse.net>
To: pgsql-general@postgresql.org
To: pgsql-admin@postgresql.org
To: pgsql-interfaces@postgresql.org
Subject: help
Date: Tue, 19 Dec 2000 14:01:46 -0500
Message-ID: <006101c069ee$227ffd00$a33b8acc@sitedom> (raw)

Help me for "DBI->connect failed: Sorry, too many clients already."
my cgi program is test.cgi:
#######################
require "./connectdb.pl";
&connectdatabase();
$query="select count(*) from messages";
$sth=$dbh->prepare($query);
$sth->execute();
$count=$sth->fetchrow_array();
print "Content-type: text/html\n\n";
print <<"TAG";
<html>
<body>
<h2> The count is $count. </h2>
</body>
</html>
TAG
exit 0;
#############
my connectdb.pl :
sub connectdatabase {
#  my ($dbusername,$dbpassword)=@_;
  $dbusername="postgres";
  $dbpassword="lokicom";
  $dbname="mboardsony";
  use DBI;
  $dbh=DBI->connect("dbi:Pg:dbname=$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 message:
"DBI->connect failed: Sorry, too many clients already."
  Who can help me?
  Thank you ahead.
  
  My email: joel_xue@hotmail.com

view thread (40+ messages)  latest in thread

Message-ID: <006101c069ee$227ffd00$a33b8acc@sitedom>
Permalink:  ../006101c069ee$227ffd00$a33b8acc@sitedom/
Also on:    postgresql.org/message-id/006101c069ee$227ffd00$a33b8acc@sitedom

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: joseph@sitewarehouse.net, pgsql-general@postgresql.org, pgsql-interfaces@postgresql.org
  Subject: Re: help
  In-Reply-To: <006101c069ee$227ffd00$a33b8acc@sitedom>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox