I am trying to do rake db:create
in one of my rails app. I get the error that says
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"new-db", "pool"=>5, "username"=>"root", "password"=>"password"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
This is what my database.yml
looks like
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: new-db
pool: 5
username: root
password: password
I tried adding host:localhost
in above code, It didn't work.
Also, when I am trying to login to mysql with mysql -u root -password
, I am getting
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Can someone please help here..