title: ERROR 1045 (28000): Access denied for user '<username>'@'localhost' (using password: YES)
body: <p>I realize there are other similar questions, however I haven't found one that is exactly what I'm having. My issue is that I'm trying to access the Rails dbconsole but it's using the wrong user.</p>
  
  <p>To explain, here's my database.yml:</p>
  
  <pre><code>development:
    adapter: mysql2
    host: localhost
    database: db/development.mysql2
    user: root
    password: password
    pool: 5
    timeout: 5000
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    adapter: mysql2
    database: db/test.mysql2
    host: localhost
    user: root
    password: password
    pool: 5
    timeout: 5000
  
  production:
    adapter: mysql2
    database: db/production.mysql2
    host: localhost
    user: root
    password: password
    pool: 5
    timeout: 5000
  </code></pre>
  
  <p>When I try and access the console by typing <code>rails dbconsole</code>, this is the result:</p>
  
  <pre><code>$ rails dbconsole
  Enter password: 
  ERROR 1045 (28000): Access denied for user 'marshallsherman'@'localhost' (using password: YES)
  </code></pre>
  
  <p>I can log in to mysql by typing <code>$ mysql -uroot -ppassword</code> AND by typing <code>$ mysql -umarshallsherman -ppassword</code>. But when I try and log into the <code>$ rails dbconsole</code> it defaults to the "marashallsherman" user, and this is incorrect. </p>
  
  <p>This seems like such a stupid question, however, I don't know how to change the "default" user for the dbconsole so that I can log in with the info that's in my database.yml file.</p>
  
  <p>Help? I'm on Mac OS X 10.9.2</p>
  
  <p>EDIT: I managed to get it so that I can log into the <code>$ rails dbconsole</code>, however, it's still logging me in as 'marshallsherman'@'localhost' -- I can't figure out how to switch it to log me in as 'root'@'localhost'.</p>