Question

Hi I am followed the following tutorial http://wiki.dreamhost.com/RVM. I got it to start with phusion although it was using sqllite3. I wanted to use mysql database instead and now when i try rake db:create i get the following message

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

The problem that I have however is I changed the gem to mysql2 in the Gemfile. and I had to install database.yml that look similar

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: domain_dev
  pool: 5
  username: ******
  password: ******
  host: mysql.wyw.mydomain.ca

But i dont understand where the socket is? I also i am not to sure how to restart rails. I did stop passenger with ctr+c but i don't know if it really restart like on a local machine with rails s by just doing the following passenger start.

I am using dreamhost.

Was it helpful?

Solution

Maybe you forgot to specify a port. I wouldnt expect the connector to use a socket tough if none is specified. My guess is this isn't your entire database.yml file and there is a socket config in there.

development:
  adapter: mysql2
  encoding: utf8
  database: domain_dev
  username: xxxx
  password: xxxx
  host: mysql.wyw.mydomain.ca
  port: 3306
  pool: 5
  timeout: 5000
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top