Mysql2::Error: Can't create database

R

Rajesh B.

Hi all


database yml------

development:
adapter: mysql2
database: db_test
username: root
password:
------------------

i have installed mysql2 and 64bit mysql server.
when i run rake db:create it gives me this errror

does any one know whats happening here?


macbook:test_proj rathod$ rake db:create --trace
(in /Users/rathod/Desktop/test_proj)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
rake aborted!
Mysql2::Error: Can't create database 'db_database' (errno: 2): CREATE
DATABASE `db_database` DEFAULT CHARACTER SET `utf8` COLLATE
`utf8_unicode_ci`
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:207:in
`rescue in log'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:199:in
`log'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:314:in
`execute'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:406:in
`create_database'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:68:in
`rescue in create_database'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:39:in
`create_database'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:35:in
`block (2 levels) in <top (required)>'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in
`call'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in
`block in execute'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in
`each'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in
`block in invoke_with_call_chain'
/Users/rathod/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in
`mon_synchronize'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_task'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in
`block (2 levels) in top_level'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in
`each'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in
`block in top_level'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in
`top_level'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in
`block in run'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in
`run'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/bin/rake:31:in
`<top (required)>'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
 
C

Chris Kottom

[Note: parts of this message were removed to make it a legal post.]

Do you really have no password on the root account for your MySQL install?
 
P

Phillip Gawlowski

i have installed mysql2 and 64bit mysql server.
when i run rake db:create it gives me this errror

does any one know whats happening here?

MySQL can't create the database.

A quick google turns up this:

http://groups.google.com/group/sequ...hread/4c1175ac05706d11/8b68c03585c33b1f?pli=1

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top