MAK
MAK

Reputation: 775

Mysql2 Installation in Ruby on Rails

When i try to run the command rake db:create:all it's giving the following error:

rake db:create
Can't connect to MySQL server on 'localhost' (10061)
Couldn't create database for {"adapter"=>"mysql2", "database"=>"db/test", "username"=>"root", "password"=>nil, "host"=>"localhost", "pool"=>5, "timeout"=>5000}, charset: , collation:
Can't connect to MySQL server on 'localhost' (10061)
Couldn't create database for {"adapter"=>"mysql2", "database"=>"db/development", "username"=>"root", "password"=>nil, "host"=>"localhost", "pool"=>5, "timeout"=>5000}, charset: , collation:

Upvotes: 0

Views: 997

Answers (2)

MAK
MAK

Reputation: 775

@dary7yl Thank you dary..it's able to creating the tables. The problem is solved by after installing the xamp and run the mysql server. And i also made one change in database.yml file ..i changed the database name from "db/development" to "development"..beacuse the mysql giving me the error when i try to given the database name with "db/name"...Once again thank's man..

Upvotes: 0

dar7yl
dar7yl

Reputation: 3757

Is the information in config/database.yml correct? The "db/test" and "db/development" look suspicious for database names.

And never use root access in your programs, even in testing. Go through the effort to create SQL users and GRANT appropriate access capabilities.

Upvotes: 1

Related Questions