Trouble creating MySql database

298 views
Skip to first unread message

dyla...@gmail.com

unread,
Oct 20, 2013, 2:07:39 PM10/20/13
to ror_ec...@googlegroups.com
Hi,

I am having trouble setting up the Mysql database. Every time I run rake db:create:all I receive this error:

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

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

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

I have tried a couple solutions that were mentioned on stack over flow, they are as follows:

change host: localhost to host: 127.0.0.1
changed the database names from: ror_ecommerce_development to db/development.mysql2
tried changing database.yml to database.yml.mysql

I don't really understand this problem, if someone could please provide a reference on how to solve this problem I would greatly appreciate it.

-Dylan

David Henner

unread,
Oct 20, 2013, 11:52:25 PM10/20/13
to ror_ec...@googlegroups.com
If you are on a mac download mysql_pro and manually add ror_ecommerce_development

Also you don't want all environments, just test & development

The command you are looking for is just 

     rake db:create

not :all

Last if you are not on a mac you will need to change "socket"=>"/tmp/mysql.sock"
I'm guessing you would need to change other things too.  BTW  i never add a password on my local db.. makes things easier

Dave


--
You received this message because you are subscribed to the Google Groups "ror_ecommerce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ror_ecommerc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages