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>'' -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Mar-25 18:06 UTC
Re: Mysql2::Error: Can''t create database ''db_database''
On 25 Mar 2011, at 17:24, "Rajesh B." <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> 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? >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> > 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>'' > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.