Forum archive
Drupal7 : PDOException: SQLSTATE[28000] [1045] Access denied
After install of turnkey-drupal7-13.0-wheezy-amd64-vmdk.zip (Version 13 stable) on a Windows7 64-bit machine, going to 10.0.0.5 in browser shows
Error The website encountered an unexpected error. Please try again later. Error message PDOException: SQLSTATE[28000] [1045] Access denied for user 'drupal7'@'localhost' (using password: YES) in lock_may_be_available() (line 167 of /var/www/drupal7/includes/lock.inc).
When VirtualBox Linux is shut down, this is shown: "Stoppng MySQL database server FAILED"
PHPMyAdmin shows in red: "Connection for controluser as defined in your configuration failed."
Help please.
For some reason, your script to create the drupal7 database does not put the same password in the settings.php file and the MySQL database.
Here's how I fixed this:
1) Webmin -> Text Editor -> open file /var/www/drupal7/sites/default/settings.php
2) Find section like this:
$databases = array ( 'default' => array ( 'default' => array ( 'database' => 'drupal7', 'username' => 'drupal7', 'password' => '9d69c5yter76a85034f4e272b289db', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', ),3) Copy password shown above, go to Webmin -> MySQL Database Server -> User Permissions
4) Selected user "drupal7" and edit to change password to one shown above
Solved.