# Connecting to mysql on locomotive

**URL:** <https://www.ruby-forum.com/t/connecting-to-mysql-on-locomotive/151794>\
**Category:** Rails\
**Created:** [October 25, 2008, 9:38pm UTC](https://www.ruby-forum.com/t/connecting-to-mysql-on-locomotive/151794 "2008-10-25T21:38:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [October 25, 2008, 9:38pm UTC](https://www.ruby-forum.com/t/connecting-to-mysql-on-locomotive/151794/1 "2008-10-25T21:38:29Z")

</div>

Hi, I am having trouble connecting to mysql on a locomotive  
installation. Everything is working fine through my rails application  
(it is able to read the database via the database.yml configuration),  
but when I try to connect through mysql Administrator or some other  
GUI type tool, it says the following error.

Connection error. Could not connect to MySQL instance on localhost.  
Error: Can’t connect to local MySQL server through socket ‘/tmp/  
mysql.sock’ (2) (code 2002).

I tried to find the .sock file but I am not sure where to find it in  
the locomotive installation so that I can map to it.

Thanks,  
Tim

---

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [October 25, 2008, 11:20pm UTC](https://www.ruby-forum.com/t/connecting-to-mysql-on-locomotive/151794/2 "2008-10-25T23:20:25Z")

</div>

On Sat, Oct 25, 2008 at 12:37 PM, Tim [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi, I am having trouble connecting to mysql on a locomotive  
> installation. Everything is working fine through my rails application  
> (it is able to read the database via the database.yml configuration),  
> but when I try to connect through mysql Administrator or some other  
> GUI type tool, it says the following error.

> I tried to find the .sock file but I am not sure where to find it in  
> the locomotive installation so that I can map to it.

I have no idea what ‘locomotive’ is but if the database.yml file has the  
correct connection information, why don’t you look at what it says??  
At least in all my MySQL-based Rails apps, that includes the socket  
path…

## HTH,

Hassan S. ------------------------ removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [October 26, 2008, 9:46am UTC](https://www.ruby-forum.com/t/connecting-to-mysql-on-locomotive/151794/3 "2008-10-26T09:46:15Z")

</div>

Locomotive is (was) a one-click installer for Osx that includes Ruby +  
MySQL + Rails + other fancy stuff. It is no longer maintained, and  
therefore should not be used anymore.

---

<div class="post-metadata">

**Author:** ![tim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@tim](https://www.ruby-forum.com/u/tim)\
**Post date:** [October 27, 2008, 1:06pm UTC](https://www.ruby-forum.com/t/connecting-to-mysql-on-locomotive/151794/4 "2008-10-27T13:06:08Z")

</div>

Have you tried connecting to your server by address and port instead  
of using the mysql.sock file? I am not sure if Locomotive was  
configured to allow connection via the socket.
