Mysql2::Error: Can't create database 'db_database'

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:inlog’
/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:increate_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:increate_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:incall’
/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:ineach’
/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:inblock 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:ininvoke_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:ininvoke_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:ineach’
/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:instandard_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:inblock 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:inrun’
/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:inload’
/Users/rathod/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `’

On 25 Mar 2011, at 17:24, “Rajesh B.” [email protected] wrote:


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?

perror says that 2 means no such file or directory. I’d guess that mysql
is configured incorrectly, eg the path it is trying to store files at
doesn’t exist (or isn’t writable by the user mysql is running as)

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs