# Mysql.sock error message

**URL:** <https://www.ruby-forum.com/t/mysql-sock-error-message/75438>\
**Category:** Rails\
**Created:** [November 9, 2006, 10:26pm UTC](https://www.ruby-forum.com/t/mysql-sock-error-message/75438 "2006-11-09T22:26:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![n00b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@n00b](https://www.ruby-forum.com/u/n00b)\
**Post date:** [November 9, 2006, 10:26pm UTC](https://www.ruby-forum.com/t/mysql-sock-error-message/75438/1 "2006-11-09T22:26:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![n00b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@n00b](https://www.ruby-forum.com/u/n00b)\
**Post date:** [November 9, 2006, 10:38pm UTC](https://www.ruby-forum.com/t/mysql-sock-error-message/75438/2 "2006-11-09T22:38:37Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![n00b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@n00b](https://www.ruby-forum.com/u/n00b)\
**Post date:** [November 9, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/mysql-sock-error-message/75438/3 "2006-11-09T23:03:06Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![n00b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@n00b](https://www.ruby-forum.com/u/n00b)\
**Post date:** [November 10, 2006, 7:29pm UTC](https://www.ruby-forum.com/t/mysql-sock-error-message/75438/4 "2006-11-10T19:29:09Z")

</div>

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. =)

---

<div class="post-metadata">

**Author:** ![n00b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@n00b](https://www.ruby-forum.com/u/n00b)\
**Post date:** [November 10, 2006, 3:02pm UTC](https://www.ruby-forum.com/t/mysql-sock-error-message/75438/5 "2006-11-10T15:02:20Z")

</div>

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. =)
