title: Rake aborted! Mysql2::Error: Access denied for 'user'@'localhost' (using password: YES) when trying to run rake db:migrate
body: <p>I am trying to set up the database for a rails app. But when I run "rake db:migrate" from the terminal I encounter the following error: "Mysql2::Error: Access denied for 'user'@'localhost' (using password: YES)".</p>
  
  <p>Many other people have reported similar permission errors, but none of their situations seem to describe mine. Here are some details.</p>
  
  <p>My database.yml contains:</p>
  
  <pre><code>development:
    adapter: mysql2
    encoding: utf8
    database: [directory name]_development
    pool: 5
    username: [my username]
    password: [my user password on mysql]
    host: 127.0.0.1
    port: 3306
  </code></pre>
  
  <p>My Gemfile:</p>
  
  <pre><code>gem 'rails', '4.1.2'
  gem 'sass-rails', '~&gt; 4.0.3'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'coffee-rails', '~&gt; 4.0.0'
  gem 'jquery-rails'
  gem 'turbolinks'
  gem 'jbuilder', '~&gt; 2.0'
  gem 'sdoc', '~&gt; 0.4.0',          group: :doc
  gem 'spring',        group: :development
  group :development, :test do
      gem 'rspec-rails', '~&gt; 3.0.0'
      gem 'factory_girl_rails', '~&gt; 4.0'
  end
  group :test do
      gem 'faker'
      gem 'capybara'
      gem 'guard-rspec'
      gem 'launchy'
      gem 'database_cleaner'
  end
  gem 'twitter-bootstrap-rails'
  gem 'therubyracer'
  gem 'less-rails-bootstrap'
  gem 'pg'
  gem 'mysql2'
  gem 'better_errors'
  </code></pre>
  
  <p>I have run "gem clean", "bundle update", and "bundle install" from the terminal.</p>
  
  <p>I have created the development database by signing in to the mysql monitor using "mysql -u root -p", running "create [name]_development;", and then granting permissions on that database using "grant all privileges on <code>[name]_development</code>.* to '[user name]'@’localhost’' with grant option;". I have checked and confirmed that both that my user name and database exists. I have confirmed that user@localhost has all permissions on my database.</p>
  
  <p>I am calling rake from the directory of my rails app.</p>
  
  <p>Any suggestions appreciated!</p>