0
votes

My hard drive recently broke so I'm installing mysql on it for rails, and im having a bad time.

lets say I start with:

brew install mysql

I do the suggested launch commands:

ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

telling it to start when i sign in, and launching mysql.

if i go into a rails project and i do

rake db:create

I get an error:

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"database_development", "pool"=>5, "username"=>"root@localhost", "password"=>"password", "host"=>"localhost", "port"=>3306}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}

Am i missing a step that lets my rails apps connect up with mysql?

1
I have the same problem. Did you solve this?Drazen

1 Answers

0
votes

you need to create the databases within mysql, create the development, test and production db from the mysql prompt or from mysql administrator. You also need to setup a user to access the db. This info should be in your database.yml file.

mysql> create database database_development;
mysql> create database database_test;
mysql> create database database_production;

mysql> grant all privileges on database_development.* to 'user'@'localhost' identified by 'password';

** repeat for test and production

once you created the db, run rake db:create

hope that helps..

link to mysql GUI Tool download http://dev.mysql.com/downloads/gui-tools/5.0.html