MySQL Forums
Forum List  »  Install & Repo

Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Posted by: Roger Huston
Date: January 10, 2007 11:15PM


I have spent the last couple of hours on this and I got it to work. It seems to be a permission problem on the /var/lib/mysql directory.

chmod 775 /var/lib/mysql

should work.

I tracked this down by editing my my.cnf file and moved the mysql.sock to /tmp/mysql.sock. This fixed that problem, but I had another which lead me to an equally long forum listing:

Fatal error: Can't open and lock privilege tables: Table '' doesn't exist

Actually this error always occurred in the log, but the fact I did not get the sock error gave me hope. When I ls -al the listing I noticed that the mysql group did not have write permission to the directory so I chmod away and it worked.

Lastly, I had to move back my new /tmp/mysql.sock entry to /var/lib/mysql as it turns out not every utility reads the my.cnf correctly: mysqld_safe kept giving me problems so instead of editing that file, I just put everything back.

Wow, I have only been at Linux a week now, very cool.


Options: ReplyQuote

Written By
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
January 10, 2007 11:15PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.