I use Drupal 7 and windows 7.

I've got a live site and I wanted to move it to local, so that I can syncronize the websites afterward.

I used the "backup and migrate" module and Wamp server.

We should be able to access the site at localhost/younideal.ch/accueil

I did the following:

1) Install wamp (be sure that the green icon is there)

2) Download the drupal folder on the live site and place it in wamp/www


3) Open the setting.php file which is located in "Sites/default/setting.php" and find the username/password and the name of the database.


4) Create a new user in phpmyadmin with the username found at step 3) and the same password. Give him all the privileges. Create at the same time a new database(with the name included in the setting.php) linked to the user.


5) Make a backup of the live site database using the "backup & migrate" module and import it in the database created at step4) using phpmyadmin.


But when I want to access my site, I get the error:

PDOException: SQLSTATE[HY000] [1045] Access denied for user 'usernamehere'@'localhost' (using password: YES) in lock_may_be_available() (line 167 of C:\wamp\www\drupal\includes\lock.inc).


Anyone understand why I get this?


(Just to be sure it is not a windows restrictions on privileges, I unchecked the "read-only" option on the setting.php file)


  • try editing your database user and change client form % to localhost – shrish Jul 10 '14 at 7:04

You need to allow your mysql user to connect from localhost. Right now only "%" have access to mysql. You have two choices

  1. Either ask mysql to allow user to connect from localhost. by running this SQL "GRANT ALL PRIVILEGES ON younidea_dru1.* TO 'younidea_dru1'@'localhost' IDENTIFIED BY 'yourpassword';" http://dev.mysql.com/doc/refman/5.1/en/grant.html
  2. Update your setting file host field with your local IP address of machine. e.g.
| improve this answer | |
  • That worked! I used the first choice and ran this SQL, then refreshed the privileges. Thank you very much for the help! Just in case anyone read this, do not forget to go to admin->config->file system and then set up the right path to the tmp directory. – massakre Jul 10 '14 at 16:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.