Forum Moderators: coopster
Warning: MySQL Connection Failed: Too many connections in /usr/local/psa/home/vhosts/mydomain.com/classes/mysql.php on line 15
I'm no php programmer and the guy I use has gone for the day (he did send me some code but it hasnt fixed it, see code below).
Can anyone tell me if this is something can be fixed by my host? I read somewhere that it was a setting on the host that they need to change to allow more connections.
----------
I replaced some code in my mysql file with this which the programmer guy sent me:
function MySQLDB() {
if ($this->port!= 0) $this->host .= ":".$this->port;
$this->linkID = mysql_connect($this->host,$this->user,$this->password);
register_shutdown_function ( array($this, "MySQLDBClose") );
return $this->linkID;
}
function MySQLDBClose()
{
@mysql_close($this->linkID);
}
Many thanks if someone can help. my site has been down for the last our because of this.
Most command line access nowadays is not performed via telnet, but SSH. There is a free program called PuTTY that works nicely. Google for PuTTY SSH and I'm sure you'll find a download. That said, you still aren't going to be able to change the MySQL config.
The only people that may to be able to troubleshoot this will be your hosting provider -- contact them as soon as the issue occurs. About the only thing you can do, as bcolflesh also stated, is make sure your scripts are closing properly.