Monthly Archives: June 2018

How to Solve #1045 Error in phpMyAdmin

We Successfully instal WAMP server in localhost for programing, but after installing WAMP server we tryping to
access the phpMyAdmin you may encounter the error:

#1045 Access Denied for user 'root'@'localhost' (using password: YES).

This may happen if you provided a wrong password or if your root@localhost database user was not granted the necessary rights to access the database.


#1045 Access Denied for user 'root'@'localhost' (using password: NO).

In this tutorials; shows how to solve this problem easily.

Let’s learn how to get rid of it.

Step #1. Open Your MySQL Console

  • Left click your WAMP icon located at the bottom right of your desktop.
  • Click on MySQL Console.

Step #2. Enter the Provided Commands

If you have a password, you can ignore this part.

  • Type in:
    use MySQL;
  • Press Enter.
  • Set your MySQL password with the following command, replacing “EnterYourPasswordHere” with your new chosen password:
    UPDATE mysql.user SET Password=PASSWORD("EnterYourPasswordHere") WHERE User="root";

  • Press Enter.
  • Flush the privileges by typing:
  • Exit by typing:
  • Press Enter.

Step #3. Edit Your File

Using a text editor, such as Notepad++, open your file.

  • Go to My Computer > C Drive > (Your Local Server Folder, WAMP/MAMP/XAMPP) > APPS > PHPMYADMIN >
  • Find the following line of code:
    $cfg['Servers'][$i]['password'] = '';

  • Change the ‘password’ to the newly chosen password you created in Step #2.
  • Click Save.

Step #4. Access Your phpMyAdmin

Go to http://localhost/phpMyAdmin and test your phpMyAdmin access.