Ruby on Rails: rake db:create → “Couldn’t create database for …
June 14, 2010 | databases, ruby / ruby on railsauthor: Karol Zielinski | comments: 0 | views: 1126
Tags: mysql, ruby on rails
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 …”
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.
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.