Wamp phpMyAdmin error #1045 - Access denied for user 'root'@'localhost'

mysql, phpmyadmin, root, wamp

Solution

Step 1: Open your MySQL console.

Step 2: Enter the Provided Command Lines

$`use mysql;` $`UPDATE mysql.user SET password="PASSWORD("YourPassword") WHERE user="root";` $`FLUSH PRIVILEGES;` $`exit;`

Step 3: Open and edit your config.inc.php file located in your local server files

- Go to My Computer > C Drive > ( Your Local Server Folder, WAMP/MAMP/XAMPP ) > APPS > PHPMYADMIN > config.inc.php

- Using a text editor, such as Notepad++, open your config.inc.php file.

- Find this line of code: $cfg['Servers'][$i]['password'] = ''; // MySQL password

- Change ['password'] = ''; --to--> ['password'] = 'YourPassword'; with the new chosen password you created from Step 2.

- Click Save

Step 4: Go to phpmyadmin go to `http://localhost/phpMyAdmin/`.

Problem

This is quite common problem and I found a lot of tutorials to help me solve it, although, there is one additional problem with my case... This is my config settings in config.inc.php ``` $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = ''; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'root'; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Servers'][$i]['AllowNoPasswordRoot'] = true; ``` When I try to log in via wamp main page, the error shows: 1045 - Access denied for user 'root'@'localhost' (using password: YES) AND this same is when I try to acces MyAdmin by CONSOLE! No matter what I type as password or just press enter, it shows me this same error, and because of that i cant 'flush priviliges'. What can I do?

Original source