I am unable to setup my MySQL DB for Ruby on Rails. After setting up the DB and making sure the config/database.yml file match, I am running into the error message below.
U:\Rails\alpha>rake db:migrate --trace
(in U:/Rails/alpha)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
Access denied for user 'admin'@'207-237-91-100.c3-0.avec-ubr13.nyr-avec.n
y.cable.rcn.com' (using password: YES)
C:/Ruby187/lib/ruby/gems/1.8/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/client.rb:
37:in `connect'
C:/Ruby187/lib/ruby/gems/1.8/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/client.rb:
37:in `initialize'
C:/Ruby187/lib/ruby/gems/1.8/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/con
nection_adapters/mysql2_adapter.rb:14:in `new'
C:/Ruby187/lib/ruby/gems/1.8/gems/mysql2-0.2.6-x86-mingw32/lib/active_record/con
nection_adapters/mysql2_adapter.rb:14:in `mysql2_connection'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:230:in `send'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:230:in `new_connection'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:238:in `checkout_new_connection'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:194:in `checkout'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:190:in `loop'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:190:in `checkout'
C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:189:in `checkout'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:96:in `connection'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_pool.rb:318:in `retrieve_connection'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connectio
n_adapters/abstract/connection_specification.rb:89:in `connection'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/migration
.rb:486:in `initialize'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/migration
.rb:433:in `new'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/migration
.rb:433:in `up'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/migration
.rb:415:in `migrate'
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/railties/
databases.rake:142
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_cal
l_chain'
C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal
l_chain'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/Ruby187/bin/rake:19:in `load'
C:/Ruby187/bin/rake:19
I've checked the password about 15+ times and it's correct as far as I can tell.
database.yml file:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: dbname
pool: 5
username: admin
password: pwhere
host: sql.domain.com
Thanks
You permissions are incorrect. This is such a lame error because it really means two things. 1) you have the wrong password/username combination; also, you cannot connect to mysql which could seriously mean connecting to a gem problem,installation problem. Mysql can get fussy!
From your question, I'm gathering that you're pretty new to all of this. What i would suggest is instead of worry about connecting to MySQL, you start with sqlite. You don't need fulltext search and the other features that lite doesn't provide!
So, let's get started with sqlite3. How?
It's less work. Just make a rails app, and
rake db:create
and you are done. Then when you need the features of a mysql database you can really know what's going on with the errors in terms of you being familiar with Rails and debugging.One way to test this would be to connect to mysql on the command line from the machine where rails lives. Something like
You likely will find that you can't connect that way, either. If so, you've probably got a GRANT problem, which is probably due to specifying the wrong host in the GRANT. For example, if the DB and rails reside on the same machine, mysql may think you are connecting from 'localhost', instead of the DNS name of the rails box (or vice versa).
At the outset you may simply want to grant the admin user access to everything:
mysql grant syntax
The trick is often getting 'whereever_rails_lives' right.