PDA

View Full Version : MySQL Errors, help please


Gastongr
Sat 26th Aug '06, 3:46pm
Hello,
i have a forum that seems to work well, there are no errors when i'm on it. But at night i get emails about mysql errors like these.

Database error in vBulletin :

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
/home/gaston/public_html/includes/class_core.php on line 271

MySQL Error :
Error Number :
Date : Saturday, August 26th 2006 @ 05:53:55 AM
Script : http://www.webmastershelp.com/archive/index.php?t-23.html
Referrer : http://www.webmastershelp.com/archive/index.php?f-17.html
IP Address : 70.42.51.10
Username :
Classname : vb_database

Database error in vBulletin :

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
/home/gaston/public_html/includes/class_core.php on line 271

MySQL Error :
Error Number :
Date : Saturday, August 26th 2006 @ 05:53:24 AM
Script : http://www.webmastershelp.com/showthread.php?p=1630
Referrer :
IP Address : 72.30.61.81
Username :
Classname : vb_database
Both seem to be the same (line 271 of class_core.php) but in different scripts.

Then this one saying there are too many connections
Database error in vBulletin :

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections
/home/gaston/public_html/includes/class_core.php on line 271

MySQL Error :
Error Number :
Date : Saturday, August 26th 2006 @ 05:51:54 AM
Script : http://www.webmastershelp.com/archive/index.php?t-9.html
Referrer : http://www.webmastershelp.com/archive/index.php?f-17.html
IP Address : 70.42.51.10
Username :
Classname : vb_database

I have a few ad-ons installed but no file modifications.
Using vB 3.6.0
Help appreciated

Gastongr
Sat 26th Aug '06, 3:50pm
Now i get why everything is in line 271, the connection there :P
do
{
$link = $this->functions[$usepconnect ? 'pconnect' : 'connect']("$servername:$port", $username, $password);
}

Steve Machol
Sat 26th Aug '06, 4:02pm
1. mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Please see this page for the causes of this error:

http://www.vbulletin.com/docs/html/cantconnect

2. mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections

The server has maxed out the number of MySQL connections it allows. You can try turning persistent
connections off in your config.php:

// ****** MASTER DATABASE PERSISTENT CONNECTIONS ******
// This option allows you to turn persistent connections to MySQL on or off.
// The difference in performance is negligible for all but the largest boards.
// If you are unsure what this should be, leave it off. (0 = off; 1 = on)
$config['MasterServer']['usepconnect'] = 0;

But if you still have problems after that, all you can do is ask your host to raise the maximum number of connections they allow.

Gastongr
Sat 26th Aug '06, 4:32pm
From the pointed document (http://www.vbulletin.com/docs/html/cantconnect (http://www.vbulletin.com/forum/../docs/html/cantconnect))
Can't connect to local MySQL server through socket
If you are getting this error, it means either:

1. The info in your config.php file is wrong (in which case your forums wouldn't work at all), or

2. MySQL crashed, it's not running or it can't find the socket. You need to contact your host about this. Here is more info on this error:So problem here is in my host too, because the board works most of the time.

The server has maxed out the number of MySQL connections it allows. You can try turning persistent
connections off in your config.php:Thanks so much for the info.
What is a good max number of connections?.
I think my host allows 20 now, which is really crappy even for my low traffic forum.

EDIT: Persistent connections are already off in my config.php si i will need to contact my host :(.

Steve Machol
Sat 26th Aug '06, 4:39pm
The connections issue is server-wide - not just for your forums. Frankly 20 connections, even on a user basis, is far too miserly.

Gastongr
Sat 26th Aug '06, 4:46pm
I checked the diagnostics section in the vB admincp and it says the following

max_connections: 500
max_user_connections: 8

Which is the one that matters?
Thanks for your time.

Steve Machol
Sat 26th Aug '06, 4:50pm
Both. The above error is for the server. The server exceeded 500 connections. However I would be very concerned about the 8 connections limit for your user. I have never heard of a server having this low of a limit.

You will eventually need to find a better host.

Gastongr
Sat 26th Aug '06, 6:30pm
I'll contact them a ask to please increase it, how many max user connections should i be looking for?.
Thanks again for your help

Steve Machol
Sat 26th Aug '06, 7:29pm
That depends on how busy their server is and how busy your forums are. Frankly I would advise getting away from any host that limits you to 8 MySQL connections. That is simply not a good sign.

Gastongr
Sat 26th Aug '06, 7:31pm
They restrict many things, for example i can not use the ping command, nor traceroute etc.
I'm with resellerzoom.com
Can you recommend a good alternative?

Steve Machol
Sat 26th Aug '06, 7:33pm
I suggest you view the vBulletin Hosting Options forum for advice from our customers:

http://www.vbulletin.com/forum/forumdisplay.php?s=&forumid=11

Also checkout this site:

http://www.webhostingtalk.com/

Gastongr
Sat 26th Aug '06, 8:15pm
I suggest you view the vBulletin Hosting Options forum for advice from our customers:

http://www.vbulletin.com/forum/forum...?s=&forumid=11 (http://www.vbulletin.com/forum/forumdisplay.php?s=&forumid=11)

Also checkout this site:

http://www.webhostingtalk.com/

Thanks for all your help. :)

Lionel
Mon 28th Aug '06, 3:22pm
I have the very exact problem since I went 3.60 last night. In diagnostics it says

max_user_connections0
max_connections800


But how can I even operate with 0 connections? Right now there are 61 users online?

This problem is bringing entire shared server down.

Lionel
Mon 28th Aug '06, 7:23pm
any help please? Everything was perfect before upgrading to 3.60

Now entire server is down again and am about to be homeless

Steve Machol
Mon 28th Aug '06, 7:32pm
Have you tried increasing the max_user_connections and restarting Apache?

If you need further help please start your own thread rather than hijacking someone else's.