PDA

View Full Version : Please Advise..


Oblivion Knight
Sat 31st Jul '04, 1:45pm
I'm a config newbie, so go easy with me..

Often, when trying to make a backup of my MySQL database via SSH I get the error:
Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) when trying to connect

Sometimes it will make a successful backup, but more often than not I will receive this error.


I figured I'd edit the php.ini file to try and correct this, but I don't really want to upload in case something totally screws up.. Here's what I've done (in my config.php file for vB3, the host is localhost.localdomain).

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket = /var/lib/mysql/mysql.sock

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host = localhost.localdomain

Is this likely to mess anything up, or is there a definate fix for my problem? I'm being hosted on a friend's server, and I don't really like bothering him with these issues. I mentioned it to him once before and he said he had no idea..

Steve Machol
Sat 31st Jul '04, 3:03pm
This error means either MySQL crashed, it's not running or it can't find the socket. You need to have root access to the server to fix this. Here is more info on this error:

http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html