Mysql.sock error message

Hey guys,

I was playing around with the command “rake db_schema_dump” and kept
getting this error “no such file or directory - /tmp/mysql.sock”. I
tried looking around to find this mysql.sock file; but no luck so far.

Question:
What is mysql.sock file? (how does it get created and how does it get
used)
I installed a MySQL DB and could not find this file. Could someone help
this noob?

Thank you in advance,

AT

That file is the socket that is used to connect to the MySQL server.
What distro are you using? The socket file may be in a different
location for some distros.
If the file isn’t anywhere, it probably means that MySQL is not running.
Can you connect to MySQL using the command-line client or other means(I
use Query Browser from my Windows workstation)?

Jason,

Thank you for replying so quickly.
MySQL version that I’m using is 4.1.21.
I did a search from my C:/ directory (mysql.sock) and found nothing.
Also, I could connect to MySQL using MySQL front in making sure that the
MySQL is running. Is there any other possibility why this could happen?

Thank you in advance,

AT

Jason N. wrote:

That file is the socket that is used to connect to the MySQL server.
What distro are you using? The socket file may be in a different
location for some distros.
If the file isn’t anywhere, it probably means that MySQL is not running.
Can you connect to MySQL using the command-line client or other means(I
use Query Browser from my Windows workstation)?

Jason,

You are absolutely right. Rails is trying to connect to MySQL like it
would on a UNIX box. I googled this problem and found out that instead
of using localhost in your database.yml, I have to use “127.0.0.1”. This
works like charm.

Thank you,

LWT

Jason N. wrote:

Ah. You’re on Windows.
I do develop on windows but I work on all my apps over a network share,
so they’re always running on Linux. Makes deployment go much more
smoothly. It seems like Rails is trying to connect to MySQL like it
would on a *NIX box. I don’t know why that would be happening unless you
didn’t use the Win32 binaries when you installed Ruby or something.
Also, make sure your DB settings are correct. in database.yml.
My recommendation: set up a linux box to develop on. Mine’s an older
celeron 1.4, and it works just fine. =)

Ah. You’re on Windows.
I do develop on windows but I work on all my apps over a network share,
so they’re always running on Linux. Makes deployment go much more
smoothly. It seems like Rails is trying to connect to MySQL like it
would on a *NIX box. I don’t know why that would be happening unless you
didn’t use the Win32 binaries when you installed Ruby or something.
Also, make sure your DB settings are correct. in database.yml.
My recommendation: set up a linux box to develop on. Mine’s an older
celeron 1.4, and it works just fine. =)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs