2

I'm thinking that I've done up the database.yml file improperly. The file is as follows:

default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password:
  host: localhost

development:
  <<: *default
  database: blog_development

test:
  <<: *default
  database: blog_test

production:
  <<: *default
  database: ENV['CLEARDB_DATABASE_URL']
  username: ENV['CLEARDB_DATABASE_USERNAME']
  password: ENV['CLEARDB_DATABASE_PASSWORDs']

When I run heroku run rake db:migrate I get:

Running `rake db:migrate` attached to terminal... up, run.8056
rake aborted!
Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have ClearDB installed with mysql2.

BenMorganIO
  • 2,036
  • 17
  • 37

1 Answers1

9

The solution is in the environment variable. Renaming CLEARDB_DATABASE_URL to DATABASE_URL solved the problem.

Renaming occurred in the heroku config and in the database.yml.

BenMorganIO
  • 2,036
  • 17
  • 37