Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many connections Perl and MySQL

Status
Not open for further replies.

dabits

Programmer
Apr 28, 2000
18
US
Hi!

I'm trying to track down a "Too many connections" error from MySQL. I want to make sure I don't have "connection leakage" inside Perl so I have a couple of questions:)

1. Must I do a finish on all statement handles (i.e.$sth->finish) before I disconnect the database handle (i.e.$dbh->disconnect) ?

2. Do I need to do a finish on a statement handle before I reuse it (for a different SQL statement) inside a Perl subroutine?

Thanks
Dabits

 
Hi Dabits,

No, I don't think you *do* need to do a finish() on a statement handle before re-using it or closing the db handle.

It does occur to me, however, that this might be dependant upon the DBD.

Have you tried it with a finish() before re-use etc..?

 
Hi Dabits,

You'll need to increase the MySQL connection limit.
Restart the SQL server with a bigger value for
max_connections .

To see current settings. type :
mysql> show variables;

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top