... because from time to time I'm a web developer, too
About me
Projects
Contact
Links

Ruby on Rails: rake db:create → “Couldn’t create database for …

June 14, 2010 | databases, ruby / ruby on rails
author: Karol Zielinski | comments: 0 | views: 1126
Tags: ,

I try to set environment for my new Ruby on Rails + MySQL project. However when I am doing rake db:create I can see: “Couldn’t create database for …”

Ruby on Rails

What I see is:

Couldn’t create database for {“encoding”=>”utf8″, “username”=>”my_username”, “adapter”=>”mysql”, “database”=>”my_database”, “pool”=>5, “password”=>”my_password”, “socket”=>”/tmp/mysql.sock”}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation)

What I need to do?

Change “socket: /tmp/mysql.sock” to “host: localhost” in config/database.yml

So my config/database.yml looks like:

development:
  adapter: mysql
  encoding: utf8
  database: my_database
  pool: 5
  username: my_username
  password: my_password
  host: localhost

(...)

That’s all. Everything works fine.

Bookmark and Share
Post Ruby on Rails: rake db:create → “Couldn’t create database for … to develway Post Ruby on Rails: rake db:create → “Couldn’t create database for … to Delicious Post Ruby on Rails: rake db:create → “Couldn’t create database for … to Digg Post Ruby on Rails: rake db:create → “Couldn’t create database for … to Facebook Post Ruby on Rails: rake db:create → “Couldn’t create database for … to Reddit Post Ruby on Rails: rake db:create → “Couldn’t create database for … to StumbleUpon

Related news and resources

Write a comment

Karol Zielinski :: Just a tech stuff Hello, I'm Karol Zielinski, internet evangelist, an entrepreneur, project manager and a web developer from Gdynia, Poland. I like creative design, good advertisement, social media and all kind of stuff around the web.

Most popular posts

Much more links

Karol Zielinski    |   contact me
Gdynia, Poland
RSS - Just a tech stuff - python, java blog - web development blog Karol Zielinski on twitter Karol Zielinski on LinkedIn Karol Zielinski on facebook Karol Zielinski on delicious Karol Zielinski on digg Karol Zielinski on flickr Karol Zielinski on stumbleupon Karol Zielinski on technorati