Can't connect to local MySQL server


#1

Hi,
When trying to launch my new Rails site I get the following error:
“Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”

My database.yml looks like this:
“production:
adapter: mysql
database: pixelateur_production
username: <my_username_here>
password: <my_password_here>
host: mysql.pixelateur.dreamhosters.com

What am I doing wrong? Can somebody help me out here?
Thanks.


#2

Problem solved, had the wrong environment.rb file uploaded… Sorry.


#3

I’m curious what you did to resolve this. I’m having the same issue.


#4

Then double check your software configuration and ensure you have specified the correct hostname associated with your database. If an mysql client doesn’t connect by IP it will try to connect using a different method (local socket) as a backup - and DreamHost only supports connecting by IP.

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


#5

I had this problem, and then I realised that your MySQL Hostname CANNOT be localhost. The Hostname is created during the Database creation, and is normally mysql.mydomain.com by default.