swap-nil
swap-nil

Reputation: 178

PDOException: SQLSTATE[28000] [1045] Access denied for user

I was having the same error message when starting an existing project on another computer. As the repository wasn't online already, I had to copy the whole D7 folder from PC1 to PC2, and import the database in phpMyAdmin. I've got this error as result when accessing my (localhost) homepage.

"PDOException: SQLSTATE[28000] [1045] Access denied for user '***'@'apache2-**.dreamhost.com' (using password: YES) in lock_may_be_available() (line 165 of /home/**/**.INFO/includes/lock.inc)." 

Upvotes: 1

Views: 26148

Answers (3)

philips
philips

Reputation: 1

This error appears to me when I add my user to the MySQL Workbench and use "remember my password".

If this is your case, try editing settings.php in $databases and removing the password of your user, because it is already "remembered".

Upvotes: 0

swap-nil
swap-nil

Reputation: 178

I have solved my question its for help i am writing the answer for having same problem,

firstly go to your /sites/default/settings.php and simply change these files in your new site which you want to run as well as old,

$databases = array (
  'default' => 
   array (
'default' => 
array (
  'database' => 'databasenameofyournewdatabase',
  'username' => 'usernameonthatserver',
  'password' => 'passwordonthatserver',
  'host' => 'localhost',
  'port' => '',
  'driver' => 'mysql',
  'prefix' => '',
   ),
  ),
 );

Upvotes: 2

Vasiliy vvscode Vanchuk
Vasiliy vvscode Vanchuk

Reputation: 7169

Check, that user defined at your scripts created and have permissions to using database ( on copying database you transfer data, not users and permissions)

PhpMyAdmin allow do this

Or simple create new user ( look username and password at your configuration script )

Upvotes: 2

Related Questions