I copied a drupal 7.34 install over to a new server. The host required a prefix to my database and username, so I changed settings.php to reflect the new information. Upon visiting the website, I get a MYSql PDO exception where it's denying access to the old mysql username from the previous install. This is not the new username now in settings.php.

PDOException: SQLSTATE[HY000] [1045] Access denied for user 'oldusername'@'localhost'

Why is it still configured with the old username even though I changed settings.php? How can I get it to read the settings.php file?

I feel like I'm doing something stupid here, but I also feel like may be missing some sort of cache file that needs cleared.

I checked the mysql usernames and database names match with settings.php. Even if I make the database names mismatch, I get the same error. I'm certain I am browsing the correct install.

Comments

Jaypan’s picture

I'm certain I am browsing the correct install.

I'm certain that you're not. Either that, or you're viewing the wrong install. Drupal only gets the db username from settings.php, nowhere else. This data is not cached anywhere either. So if you are seeing that error, it means that you are looking at an installation that has that information in settings.php.