PDA

View Full Version : Warning: mysql_connect() [function.mysql-connect]


pathway
11-30-2007, 11:24 AM
Hello all,
i get this message for a couple of days now:

Warning: mysql_connect() [function.mysql-connect]: User gargantu_pathway has already more than 'max_user_connections' active connections in /home/gargantu/public_html/connexion.php on line 11

Fatal error: Call to undefined function: mydie() in /home/gargantu/public_html/gar on line 11

Any suggestions please.

Thank you in advance

John Houvardas
gargantua.gr

Basil
11-30-2007, 12:06 PM
Are you using persistant connections, and just how many mysql_connects are you using (there should only be 1)?

pathway
11-30-2007, 12:16 PM
Hello Basil,

how do i check for persistant connections?

i use the following (3 times) to connect to 3 databases and it worked fine three days ago

$link = mysql_connect ($jadevars['host'], $jadevars['user_XXX'],
$jadevars['password_XXX']) or die(mysql_error());

Basil
11-30-2007, 01:31 PM
Is this 3 different databases for one application?

I don't know what the default is, if you have the php.ini file for bluehost you might want to check "mysql.allow_persistent"

pathway
11-30-2007, 02:06 PM
Hello Basil,

Yes i made 3 database for two sites. It used to work fine.
This is from mysql part or php.ini

mysql.allow_persistent = 1 ; allow or prevent persistent link
mysql.max_persistent = -1 ; maximum number of persistent links. -1 means no limit

Thank you

John

Basil
11-30-2007, 02:15 PM
I would try setting allow_persistent to 0 and seeing if that helps.

The reason it used to work and is starting to not work is because, I presume, more users are hitting it. You want to minimize the number of connections being made, if you store all your tables in one database you'll only need to make one connection to access any of the data.

Your php.ini file only has to contain "mysql.allow_persistent = 0;", but it must be in every folder containing the script.

pathway
11-30-2007, 02:25 PM
Hello again and thank you for your effort.

i modified my connection file to access just a single database but still the same

thank you

John