homepage Welcome to WebmasterWorld Guest from 184.73.52.98
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
Can't connect to local MySQL server through socket
gsmforum




msg:4279208
 11:09 pm on Mar 9, 2011 (gmt 0)

Hi all !

I'm running a vbulletin forum for 10 years now.
Suddently, i started to get problems with MySQL, getting tons of emails giving this error:

mysql_pconnect() [<a href='function.mysql-pconnect'>function.mysql-pconnect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


Anyway to fix this permanently ?
don't know what to do....

thanks

 

lammert




msg:4279860
 8:06 pm on Mar 10, 2011 (gmt 0)

Did you check if the file /var/lib/mysql/mysql.sock exists? List the directory with the following command:

ls -ladF /var/lib/mysql/mysql*

The result should be this:
drwx------ 2 mysql mysql 4096 Apr 4 2010 mysql/
srwxrwxrwx 1 mysql mysql 0 Jan 7 00:16 mysql.sock=


Sometimes the mysql.sock doesn't exist because it has been erased accidentaly, and sometimes it is not a socket but a normal file. In that case the = is missing at the end of the file name with this specific directory listing command. If it is a file, deleting that file and restarting the MySQL server should do the trick.

You should also check if there has been a recent update of MySQL on your server which changed your my.cnf file. That file should at least contain the following lines:
[mysqld]
socket=/var/lib/mysql/mysql.sock

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved