# MySQL Sockets

**URL:** <https://www.ruby-forum.com/t/mysql-sockets/154447>\
**Category:** Deployment\
**Created:** [November 29, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/mysql-sockets/154447 "2008-11-29T19:59:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadinplastic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@deadinplastic](https://www.ruby-forum.com/u/deadinplastic)\
**Post date:** [November 29, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/mysql-sockets/154447/1 "2008-11-29T19:59:02Z")

</div>

Hello,

I’m trying to get a rails app running (on Amazon EC2 using Paul  
Dowman’s ec2onrails)

The server is configured, but I can’t reach a page.  
Going to the root page brings up the familiar ‘You’re riding Ruby on  
Rails!’ screen, but accessing a known working path gives me the  
default HTTP 500 Internal Server Error page.

Checking my logs, I see this on every attempted request:

Mysql::Error (Can’t connect to local MySQL server through socket ‘/tmp/  
mysql.sock’ (2)):

My database.yml looks something like this:

production:  
adapter: mysql  
database: dbname  
username: dbuser  
password: dbpass  
socket: /var/run/mysqld/mysqld.sock

I first got this error while running migrations, so I changed the  
socket from the default /tmp/mysql.sock as it had been set on my local  
machine to the above address. The migrations ran fine after that  
changed, so I didn’t expect it to come up again, since that meant to  
me that the database was being properly accessed.

Is there any other place I need to set this value? I only know of the  
mysql socket from within database.yml so the above warning puzzles me  
as it looks like it’s connecting through the wrong socket. Could there  
be something unrelated causing this?

Thanks for any help
