3

I have tried to perform this action several times, only to find that I can never login to the previously created database when I setup my local environment. I have recently picked up the practice to have two sites: development and production, sometimes a third one in between.

Here is my process, maybe I am ommiting a step or two:

  • Create fresh local Database (same name as online) with PHPMyAdmin
  • Install Drupal 6 using this database
  • Setup Drupal installation
  • Import online Database backup onto new local installation
  • And here is where I get stuck everytime, with the dreaded:

Access denied for user 'admin'@'localhost' (using password: YES)*

I have edited settings.php file to work from local to online, so I thought I understood how to do this process in reverse, but apparently I don't.

As a last resource, I have even changed admin's and other user's passwords directly in the database via PHPMyAdmin, and used these in settings.php so I might log in, but it just won't happen.

1

First, try to do the move the project to your server again but DO NOT go through the installation process. Simple add all the files to the proper directory then move in all the data. After that, just try going to the home page.

If that wasn't it I feel like you probably skipped giving 'admin'@'localhost' permission to access your db.

Try checking admin's priviledges in the MySQL console:

mysql> SHOW GRANTS FOR 'admin'@'localhost';

If admin doesn't have privileges, go into MySQL console and:

  1. Create a user(if you don't have one made): mysql>CREATE USER 'admin'@'localhost' IDENTIFIED BY 'apassword';
  2. Now, give admin priviledges: mysql>GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'
  3. Lastly, flush! mysql>FLUSH PRIVILEGES;

Hope this fixes it!

  • 1
    Thank you very much, Mike. I'll try this as soon as I get home. :) – MauF Jan 4 '12 at 17:31
  • No problem, hopefully that's it cause if not, I don't know what else you could try. – Mike Jan 4 '12 at 17:34
  • 1
    I agree with @Mike that you are having a database administration issue. However I'd like to mention that I never "install" Drupal when importing a database from production. That is, I would eliminate steps two and three from your list above, because the database you are importing into your local or development environment was "already installed" and "re-installing" it could cause some conflicts. – amateur barista Jan 5 '12 at 0:37
  • @amateurbarista is totally right. I just moved a site from my localhost to production server and I did not "install" Drupal either. – Mike Jan 5 '12 at 5:20
  • 1
    Thank you guys. I had the feeling I didn't had to install drupal. All I wanted was to create my DB, populate my "/www "folder, and voilá! Local site, ready to go. And evidently, this it how it's supposed to be. I still have to make some tests tonight, but your input has been quite useful. – MauF Jan 5 '12 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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