MySQL 'max_user_connections' active connections

Status
Not open for further replies.

charly11

New Member
Messages
2
Reaction score
0
Points
0
Hello,

I use free web hosting and i have problem with database when trafic on my site is like 50 visitors per second.

I get this error:
Warning: mysql_connect() [function.mysql-connect]: User charly11_charly already has more than 'max_user_connections' active connections in /home/charly11/db_con_nect.php on line 3
Could not connect: User charly11_charly already has more than 'max_user_connections' active connections

Please tell me how to fix this problem.
Sorry for my bad English.

Thank you.

Dragi.
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
i would suggest modifying your script to close your mysql connections as soon as your done with them. To me it sounds like your not closing your connections. If you are than maybe someone else here can help out.
 

charly11

New Member
Messages
2
Reaction score
0
Points
0
i would suggest modifying your script to close your mysql connections as soon as your done with them. To me it sounds like your not closing your connections. If you are than maybe someone else here can help out.

Thank you for your helping but this is not a problem i close my connection.
 

ah-blabla

New Member
Messages
375
Reaction score
7
Points
0
The problem could be that you use a separate connection for each visitor, so if you get 50 visitors you get 50 connections. Try using the same connection for all visitors. (I'm not very knowledgeable in php, so I can't tell you how this would be done.)

Edit: read this article, which seems to deal with the same problem.
 
Last edited:
Status
Not open for further replies.
Top