Mysql2 :: Error: Can't connect to local MySQL server via socket '/tmp/mysql.sock' (2)

I am trying to migrate to Ruby on Rails 4 and I am getting 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? Thanks for the help.

+3


source to share


1 answer


First make sure you are actually running mysql.server start

as it is tmp/mysql.sock

generated at startup (as is traditional). If you are still facing difficulties, mysqladmin variables | grep socket

please start and update the information in your database.yml

accordingly



+22


source







All Articles