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?
LVL 1
catonthecouchproductionsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wesgarrisonCommented:
Can you connect with the username/password of root/root with the plain mysql command line console, just to confirm that your password is correct?
0
catonthecouchproductionsAuthor Commented:
I got it, I just had to add in my sock to specifiy it. Do you know if there is a way to always use that sock to by default?

0
catonthecouchproductionsAuthor Commented:
Hey, I also have another question here if you have a second:

http://www.experts-exchange.com/Programming/Editors_IDEs/RubyOnRails/Q_23866977.html

thank you!

Ryan
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

wesgarrisonCommented:

# in database.yml
  socket: /path/to/your/mysql.sock

Open in new window

0
catonthecouchproductionsAuthor Commented:
Yeah.. I got that, but is there away to set a default so everytime you create a new server it uses that? Or do I need to enter it manually?

Thanks,

Ryan
0
catonthecouchproductionsAuthor Commented:
Yeah.. I got that, but is there away to set a default so everytime you create a new server it uses that? Or do I need to enter it manually?

Thanks,

Ryan
0
wesgarrisonCommented:
"Create a new server"?  Not sure what you mean.

You'll have to set that in every Rails project you create, yes, just like you might have a different password for each database or environment you might have.
0
Andrew DoadesIT TechnicianCommented:
" 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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
catonthecouchproductionsAuthor Commented:
Thank you both! i will give that a try!

Ryan
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Ruby

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.