Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 983
MateuszC Avatar asked Nov 21 '13 20:11

MateuszC


People also ask

How do I access phpMyAdmin in WAMP?

From the WAMP start page (http://localhost) under “Tools”, start phpMyAdmin (or find the WAMP icon in the notification area, left click to open and select phpMyAdmin).

Why MySQL in WAMP is not working?

Please check the port that MySQL is using on your system. Then, change the port number of the WAMP server's MySQL service to that number by entering it in my. ini. If you're running Windows, make sure to restart service and it immediately turns green.

Why localhost is not working in WAMP?

Right click on My Computer icon -> Properties Go to Device Manager Click on View menu and chooseShow hidden devices Now from the list choose Non-Plug and Play devices Double click HTTP -> go to Driver For Type choose Disabled Restart your computer After your computer boots up you should be able to start up WAMP server.


2 Answers

Try username = root and password is blank.

like image 154
Ankit Pandey Avatar answered Oct 14 '22 20:10

Ankit Pandey


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

  1. Go to My Computer > C Drive > ( Your Local Server Folder, WAMP/MAMP/XAMPP ) > APPS > PHPMYADMIN > config.inc.php
  2. Using a text editor, such as Notepad++, open your config.inc.php file.
  3. Find this line of code: $cfg['Servers'][$i]['password'] = ''; // MySQL password
  4. Change ['password'] = ''; --to--> ['password'] = 'YourPassword'; with the new chosen password you created from Step 2.
  5. Click Save

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

like image 39
Chanaka Karunarathne Avatar answered Oct 14 '22 22:10

Chanaka Karunarathne