1

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) I have a Rails application and I am getting this error. I have no idea how to find mysql connect it to mysql.sock. I am pretty sure i can go into config/database.yml and set the mysql.sock but where is it or do I need to reinstall it?

When I do locate mysql i get alot of results including the two below

/usr/include/mysql
/usr/bin/mysql

but when I locate mysql.sock I get nothing

1 Answer 1

2

Is mysql actually running, and set to listen on the socket interface. Make sure that the server is started/configured.

well first check to see if it is running

ps auxwww | grep mysql

should do that, if not, then

/etc/init.d/mysql start 

or

service mysql start   

as root (or via sudo, should start it). but if it is running the socket should be in

/var/run/mysqld/mysqld.sock 
Sign up to request clarification or add additional context in comments.

1 Comment

well first check to see if it is running (ps auxwww | grep mysql) should do that, if not, then /etc/init.d/mysql start as root (or via sudo, should start it). but if it is running the socket should be in /var/run/mysqld/mysqld.sock

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.