Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Rails rake db:create causing error

Posted on 2008-10-31
9
Medium Priority
?
3,128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 14

Expert Comment

by:wesgarrison
ID: 22855633

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

Open in new window

0
 
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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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