Question : Rails rake db:create causing error

I am trying to start up a rails project and I run:

rake db:create

And I get:

Couldn't create database for {"encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "host"=>"localhost", "password"=>"root", "database"=>"MyProject_development"}, charset: utf8, collation: utf8_general_ci (if you set the charset manually, make sure you have a matching collation)

Any idea why? I did some searching on google and not sure why it is doing that, and my MySQL server is up. I am using MAMP, so I am not using the default mysql.sock, I tried this but not sure if it worked:

http://www.nogeek.org/2008/08/10/no-such-file-or-directory-tmpmysqlsock/

Thoughts?

Answer : Rails rake db:create causing error

" charset: utf8, collation: utf8_general_ci (if you set the charset manually, make sure you have a matching collation)"

In your config/database.yml file try to remove the line encoding: ...

I had this problem when trying to migrate to a mysql database, removing this line fixed it for me.
Random Solutions  
 
programming4us programming4us