mysql.sock and rails

322 Views Asked by At

This is not necessarily a programming question, but this issue is definitely blocking development (not to mention that there are thousands of questions on stackoverflow related to this, but none that I can see that address the issue I'm dealing with).

I've been working with rails and mysql for several months. At the time I did the install, all was fine, and up until about a week ago, I was able to run migrations, phpmyadmin, etc. without any problems.

Today, I was trying to create a new application (following the railscast 323). I also use Rubymine for an IDE.

I created the project using the IDE, project.new and created a new Rails application. I then proceeded created the scaffolding along with a migration file. I then did rake db:create and it seems as if the DB was created. When I tried doing rake db:migrate, I got the following error:

'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

I checked my config/database.yml (the file was created by the IDE) and it does have

socket: /tmp/mysql.sock

Additional information:

There is a /usr/local/var/mysql/store_development directory, so it seems as if the database was created.

I can go to /localhost/phpmyadmin, but my root password is not accepted (I did not change the root password)

I have not re-installed mysql I have not updated mysql

/tmp/mysql.sock no longer exists /usr/var/mysql/mysql.sock does not exist

Any ideas?

1

There are 1 best solutions below

0
On

First of all, make sure mysqld is running. If yes, try this:

ln -sf $(locate mysql.sock) /tmp