max_user_connections

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
nmotion
Forum Commoner
Posts: 32
Joined: Wed Jan 22, 2003 6:53 am

max_user_connections

Post by nmotion »

I had a site running fine and it has been doing so for months. Then suddenly this came:

Warning: mysql_connect(): User dvdtown_sqledit has already more than 'max_user_connections' active connections in

What could be wrong? Is there a way to fix this in the code or? Any help or ideas are appreciated.

The whole thing is coded in PHP and MySQL.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Basically it's saying that there's too many connections to the database. Is this your own server or a hosts?

Mac
nmotion
Forum Commoner
Posts: 32
Joined: Wed Jan 22, 2003 6:53 am

Post by nmotion »

It is a host.

Insiderhosting.com
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have you asked them about this problem? Do you know how many connections you're allowed - if you have a look at the output of phpinfo() what's the value of mysql.max_links?

Mac
nmotion
Forum Commoner
Posts: 32
Joined: Wed Jan 22, 2003 6:53 am

Post by nmotion »

It says Unlimited in both Local and Master.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Check with your host about how many connections you're allowed.

Mac
nmotion
Forum Commoner
Posts: 32
Joined: Wed Jan 22, 2003 6:53 am

Post by nmotion »

Doesn't unlimited mean unlimited? Or is it something else I have to ask about?

Also, this has not been a problem in the past. The site has run with many visitors for months with no problems. So it comes as a big supprise.

What I need is some information about how to solve this. Where to look. Perhaps some web sites dealing with it etc.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Your host may have only just implemented this and I doubt there'd be a way around it without getting them to tweak your user account. Of course if this is a user that you've created you may have more luck:
http://www.mysql.com/doc/en/User_resources.html

Mac
nmotion
Forum Commoner
Posts: 32
Joined: Wed Jan 22, 2003 6:53 am

Post by nmotion »

The support guy wrote:
I would look to see if you have persistent connections on or off.

What does he mean by this?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

from your phpinfo look for mysql.allow_persistent under the mysql section.

Can't believe your host couldn't tell you this.

Suppose you could change it within a script though!?

Check here to read more about persistent connections http://uk2.php.net/manual/en/features.p ... ctions.php

Mark
nmotion
Forum Commoner
Posts: 32
Joined: Wed Jan 22, 2003 6:53 am

Post by nmotion »

This one is also set to Unlimited in both Local and Master.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

i think you are looking at the wrong one. It should be On or Off.

You might be looking at mysql.max_persistent.

Has you host recently upgraded their version of PHP, that is sometimes why your scripts work fine for ages, then suddenly don't for no apparent reason.

Mark
nmotion
Forum Commoner
Posts: 32
Joined: Wed Jan 22, 2003 6:53 am

Post by nmotion »

Sorry,

It is: ON
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

I think you need to talk to your host again then.

Mark
Post Reply