catonthecouchproductions
asked on
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_dev elopment"} , 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?
rake db:create
And I get:
Couldn't create database for {"encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "host"=>"localhost", "password"=>"root", "database"=>"MyProject_dev
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?
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?
ASKER
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?
ASKER
Hey, I also have another question here if you have a second:
https://www.experts-exchange.com/questions/23866977/Working-with-db-migrate.html
thank you!
Ryan
https://www.experts-exchange.com/questions/23866977/Working-with-db-migrate.html
thank you!
Ryan
# in database.yml
socket: /path/to/your/mysql.sock
ASKER
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
Thanks,
Ryan
ASKER
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
Thanks,
Ryan
"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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both! i will give that a try!
Ryan
Ryan