3

I am trying to perform a migration in Ruby on Rails 4, and I am running into the following error:

********-C02MGBVJFD57:myapp michaelsutyak$ bundle exec rake db:migrate
rake aborted!
Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Any ideas why this is happening?

1 Answer 1

22

First verify that you have indeed run mysql.server start, as tmp/mysql.sock is generated on startup (as is tradition). If you are still encountering difficulties, run mysqladmin variables | grep socket and update the information in your database.yml accordingly

Sign up to request clarification or add additional context in comments.

2 Comments

ah the ol' "make sure the server is running" trick, eh? worked like a charm!
To find the socket path that is actually in use you may need to do it like this: mysqladmin -u root variables | grep socket

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.