tags:

views:

66

answers:

2

Hi all,

While i am browsing my online app in the server i got an error like

Database Connection Failed

User coule_com@c17564 already has more than 'max_user_connections' active connections.

But this is working well in my local system. And this error occurs ANY TIME when i navigate in the server. If i refresh the browser i can able to move further. But i in need to solve this issue.

will anybody help me to solve this issue.

Thanks in Advance

Fero

EDIT: CONNECTION CODE:

function makeConnection()

{

global $config;

$this->ConLink =

mysql_pconnect($config['DBHostName'],$config['DBUserName'],$config['DBPassword']) or

die("Database Connection Failed". mysql_error());

mysql_select_db($config['DBName'], $this->ConLink);

return true;

}
+3  A: 

Are you closing the connections when you're done with them?

If not, then I would assume there's lots of database connection objects lying around just waiting for GC to pick them up, and until it does, you risk running out of available connections.

Lasse V. Karlsen
The application is a shopping-cart site. In this how can i able to close the connection. I think that i the connection availability all the time. This is an assumption. Any suggestions will be acceptableThanks
Fero
Well, the "php" tag and the mention of a browser suggests that he... is trying to run a web application written in PHP, which means that all the connection objects are collected in the end of request (which shouldn't take long) automatically. Unless, of course, he has explicitly specified that the connection has to be persistent.
Ignas R
+1  A: 

you need to contact your host and get them to up the connection limit. if they won't, you need to find a better host. this is simply a fact of life in web-based applications.

longneck