title: Access denied for user on MySQL database
body: <p>I have a single user for two databases on my website. First and older database DB_A is real database while newer DB_B is just for testing purposes.</p>
  
  <p>My user, let's call it USER_X has all privileges (except 'DROP') on both of them and I'm sure that my username, password and DB name are all written correctly within PHP.</p>
  
  <p>When connecting to DB_A and throwing
      <code>if(!mysql_select_db($dbname)) echo mysql_error();</code>
  I get nothing, in other words, everything works fine.</p>
  
  <p>When connectin to DB_B and throwing the same thing, I get
      <code>Access denied for user 'USER_X'@'localhost' to database 'DB_B'</code>.</p>
  
  <p>Once again, I'm sure my credentials are correct and that I have all privileges on the DB_B database.</p>
  
  <p>Anyone has an idea what's going on in here?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT:</p>
  
  <p>PHP v.5.2.17</p>
  
  <p>MySQL v.5.0.96</p>