Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

i have installed mysql 5.5.11 and i'm running on Snow Leopard (10.6.7)

when i create my rails application everything wokrs fine:

rails fooTest -d mysql

then

cd fooTest

then

rake db:create

and i get:

Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "database"=>"fooTest_development", "pool"=>5, "password"=>nil, "socket"=>"/tmp/mysql.sock"}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation)

share|improve this question
    
Post your database.yml (hide or obfusicate your password line, and maybe also your host line!). I suspect something else is at play here. –  Jason Salaz Apr 13 '11 at 20:31
    
Had to do some things with the MySQL root user password encryption UPDATE mysql.user SET Password=OLD_PASSWORD('NewPassword') WHERE User='root'; FLUSH PRIVILEGES; –  Mr_Nizzle Apr 19 '11 at 15:53

2 Answers 2

This looks like a permissions problem. Make sure you have a password set in your mysql and are able to login from the command line

mysql -u root -p

This should prompt you for your root password. If you can login there, that means you should be set. All you need to do then is put the password in your database.yml file and retry the rake command.

share|improve this answer

Try using the gem mysql2 in RoR. I had the same problem as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.