Unable to connect to database ! Unable to connect to database !
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Unable to connect to database !

Started by Master of Orion, May 11, 2007, 08:50:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Master of Orion

Hi dear developers of Coppermine !

Our photo collection http://china.kulichki.com/pictures/ have    files and we are having about 10.000 views of Coppermine's pages .
Our Coppermine - 1.4.9 .  Run at Apache/1.3.33 (Unix) PHP/4.4.1 rus/PL30.20    MySQL  Client API version 4.0.26

Often a error like this are occur –
Coppermine critical error:
Unable to connect to database !
MySQL said: User china has already more than 'max_user_connections' active connections

Our server administrator says that its problem with the Coppermine system. Coppermine cannot able to serve so many pictures and page views...

It is possible?  Can Coppermine more pics than  25948  and more views? 
What I must to do?

Master of Orion

This Picture collection have 25948 files in 579 albums and 48 categories with 6918 comments viewed 2175067 times

Nibbler

Get the 'max_user_connections' increased then.

Master of Orion

Connections about 400 seconds «connecting» to base and administrator say that connection not closed automatically

Nibbler

Connections are closed automatically unless you have made code modifications. I don't understand the rest of your reply.

Master of Orion

Can Coppermine support  more pics  than  25948  and more views than 10.000?

Nibbler

Yes, easily. The limiting factor is your hardware and server setup.

eka

Hi Nibbler,

I've also been getting this problem - "Mysql said: too many connections"

How do you increase the "max_user_connections" ?

Pse advice.

Thanks.

eka

Hi Nibbler,

forget my request - I'm reading up on it.

thanks.

Veronica

For MySQL too many connections error message try to use MySQL with persistent connections

For details read this:
http://se.php.net/manual/en/function.mysql-pconnect.php

For updating Coppermine change in /include/functions.inc.php

from
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
to
$result = @mysql_pconnect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);

ie just add a "p" to the connect for persistent connections

eka

Hi Veronica,

thanks for the tip.

just wonder...would it create any problems anywhere?

does anybody had any experience with persistent connections?

Nibbler

Depending on how your php is setup it could either help, do nothing, or make things worse. Take it up with your host and see what they suggest. Also, there is code posted somewhere to spread the load over multiple users. You could try that - search the board.

eka

Hi Nibbler,

I searched the board, can't find anything about multiple users, but I found a thread suggesting that a way to resolve the "too many connections" problem is to reduce the number of links on the frontpage that connects to the database.

I not sure I interpreted it correctly. I have a number of images on my frontpage that are pulled from the database. If I cut done on these links to the database, would it help to resolve the connection problem?

Pse advice.

thanks.

Joachim Müller

Do as Nibbler suggested and ask you webhost for support. The number of items on each page doesn't have an impact on the "too many connections" issue.

eka

Thanks GauGau.
Will check with web host.