Solved

Rails rake db:create causing error

Posted on 2008-10-31
9
3,101 Views
Last Modified: 2013-11-13
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?
0
Comment
  • 5
  • 3
9 Comments
 
LVL 14

Expert Comment

by:wesgarrison
ID: 22855588
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
 
LVL 1

Author Comment

by:catonthecouchproductions
ID: 22855614
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
 
LVL 1

Author Comment

by:catonthecouchproductions
ID: 22855632
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
 
LVL 14

Expert Comment

by:wesgarrison
ID: 22855633

# in database.yml

  socket: /path/to/your/mysql.sock

Open in new window

0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 1

Author Comment

by:catonthecouchproductions
ID: 22855640
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
 
LVL 1

Author Comment

by:catonthecouchproductions
ID: 22855641
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
 
LVL 14

Expert Comment

by:wesgarrison
ID: 22855838
"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
 
LVL 10

Accepted Solution

by:
Andrew Doades earned 500 total points
ID: 22856485
" 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
 
LVL 1

Author Comment

by:catonthecouchproductions
ID: 22858118
Thank you both! i will give that a try!

Ryan
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now