MySQL Sockets

75 views
Skip to first unread message

RoR_pal_0001

unread,
Nov 29, 2008, 3:15:24 PM11/29/08
to Deploying Rails
>>Posted this on Talk group before noticing deploy group, my apologies if you've seen this before:

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

Aníbal Rojas

unread,
Nov 29, 2008, 7:22:59 PM11/29/08
to rubyonrails...@googlegroups.com
Are you sure you are running it production mode?

--
Aníbal Rojas
http://hasmanydevelopers.com
http://rubycorner.com
http://anibal.rojas.com.ve

RoR_pal_0001

unread,
Dec 1, 2008, 5:23:11 PM12/1/08
to Deploying Rails
I have fixed the problem, by redeploying with Capistrano. I don't know
what was causing it. I was deploying in production mode, yes, and I
had even tried setting the sockets to the proper location in
development, test and production and restarting, without fixing the
problem. I'm glad it's fixed, because I wouldn't have known what else
to do.



On Nov 29, 7:22 pm, "Aníbal Rojas" <anibalro...@gmail.com> wrote:
> Are you sure you are running it production mode?
>
> --
> Aníbal Rojashttp://hasmanydevelopers.comhttp://rubycorner.comhttp://anibal.rojas.com.ve

Aníbal Rojas

unread,
Dec 1, 2008, 5:38:51 PM12/1/08
to rubyonrails...@googlegroups.com
Are you sure the process were being killed properly?

--
Aníbal

shrikant

unread,
Jan 13, 2009, 3:37:08 AM1/13/09
to Deploying Ruby on Rails
Dear,
Please use following setting, may be work.
----------------------
production:
adapter: mysql
database: dbname
username: dbuser
password: dbpass
socket: /var/lib/mysql/mysql.sock
---------------------

Thanks-
Shrii

On Dec 2 2008, 3:38 am, "Aníbal Rojas" <anibalro...@gmail.com> wrote:
> Are you sure the process were being killed properly?
>
> --
> Aníbal
>
> On Tue, Dec 2, 2008 at 5:53 PM, RoR_pal_0001 <cycli...@gmail.com> wrote:
>
> > I have fixed the problem, by redeploying with Capistrano. I don't know
> > what was causing it. I was deploying in production mode, yes, and I
> > had even tried setting the sockets to the proper location in
> > development, test and production and restarting, without fixing the
> > problem. I'm glad it's fixed, because I wouldn't have known what else
> > to do.
>
> > On Nov 29, 7:22 pm, "Aníbal Rojas" <anibalro...@gmail.com> wrote:
> >> Are you sure you are running it production mode?
>
> >> --
> >> Aníbal Rojashttp://hasmanydevelopers.comhttp://rubycorner.comhttp://anibal.rojas....
Reply all
Reply to author
Forward
0 new messages