title: Correct username and password in database.yml, but password not accepted
body: <p>On OS X lion, I can't find why it won't accept my password. I can connect to the database and administer it from the mysql workbench, but rails doesn't seem to be able to connect.</p>
  
  <p>Mysql was installed from the dmg downloaded from the mysql site.</p>
  
  <p>I've tried granting privileges from the mysql command line:</p>
  
  <pre><code>GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'
  </code></pre>
  
  <p>This is the trace from: <code>rake db:create</code> I also tried <code>bundle exec rake db:create</code></p>
  
  <pre><code>Access denied for user 'root'@'localhost' (using password: YES)
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.10/lib/mysql2/client.rb:44:in `connect'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.10/lib/mysql2/client.rb:44:in `initialize'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `n
  ew'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `m
  ysql2_connection'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:304:in `new_connection'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:323:in `checkout_new_connection'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:265:in `block (2 levels) in checkout'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:261:in `loop'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:261:in `block in checkout'
  /Users/adamar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:260:in `checkout'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:162:in `connection'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.r
  b:409:in `retrieve_connection'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specif
  ication.rb:107:in `retrieve_connection'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specif
  ication.rb:89:in `connection'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:97:in `rescue in rescu
  e in create_database'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:84:in `rescue in creat
  e_database'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:54:in `create_database
  '
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:42:in `block (2 levels
  ) in &lt;top (required)&gt;'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib
  /Users/adamar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/bin/rake:33:in `&lt;top (required)&gt;'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `load'
  /Users/adamar/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:create
  </code></pre>
  
  <p>EDIT: When I run: <code>mysql -u root -p</code> I get this:</p>
  
  <pre><code>Adamars-MacBook-Pro:~ adamar$ mysql -u root -p
  Enter password: 
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
  </code></pre>
  
  <p>This is what my database.yml is </p>
  
  <pre><code>test:
    adapter: mysql2
    encoding: utf8
    database: linkdeck_test
    username: root
    password: 
    pool: 5
    host: 127.0.0.1
    port: 3306
  
  development:
    adapter: mysql2
    encoding: utf8
    database: linkdeck_development
    username: root
    password: 
    pool: 5
    host: 127.0.0.1
    port: 3306
  
  production:
    adapter: mysql
    encoding: utf8
    database: linkdeck_production
    username: root
    password: 
    host: 127.0.0.1
    port: 3306
  </code></pre>