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.
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.
When connecting to DB_A and throwing
if(!mysql_select_db($dbname)) echo mysql_error();
I get nothing, in other words, everything works fine.
When connectin to DB_B and throwing the same thing, I get
Access denied for user 'USER_X'@'localhost' to database 'DB_B'
.
Once again, I'm sure my credentials are correct and that I have all privileges on the DB_B database.
Anyone has an idea what's going on in here?
Thanks!
EDIT:
PHP v.5.2.17
MySQL v.5.0.96