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

8

12

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?

Jennet answered 21/11, 2013 at 20:54 Comment(2)
Are you absolutely sure that these credentials are correct?Gorgon
Which part confused you?Gorgon
K
14

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/.

Kab answered 30/11, 2014 at 20:58 Comment(0)
A
7

Change the line:

$cfg['Servers'][$i]['auth_type'] = 'config';

to

$cfg['Servers'][$i]['auth_type'] = 'cookie';

Restart and you will be asked for the password the next access to the phpmyadmin page

Afterthought answered 25/7, 2014 at 16:51 Comment(1)
I change the file C:\wamp\apps\phpmyadmin4.1.14\config.inc.php, this line $cfg['Servers'][$i]['password'] = 'new pass'; and worked!Gardal
O
4

Did you add a password to the MySQL 'root' userid?

If not, by default it comes without a password. So use

$cfg['Servers'][$i]['password'] = '';

and remove this its a defunct parameter since phpMyAdmon 3.2.0

$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
Orthopteran answered 22/11, 2013 at 21:34 Comment(0)
H
2

Try username = root and password is blank.

Haslett answered 4/10, 2017 at 14:38 Comment(0)
B
0

go to control panel > administrative tool> service >

then you will find a list of items , navigate to MYSQL

right click on its properties , in general tab start type make it automatic

then apply / save

and finally restart all services in wamp

Bentwood answered 3/12, 2013 at 14:15 Comment(0)
K
0

after changing the root password you must first enter the following in mysql console:

FLUSH PRIVILEGES;

before the changes will take effect

Do this by openening a terminal/command console and navigating to your mysql.exe example: C:\wamp\bin\mysql\mysql5.5.24\bin\mysql -u YOURUSERNAMEHERE -p

If you have fiddled with your root account and can no longer access it see the following link for resetting your root account:

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

After this it should work fine as per your config.inc.php file

Knighterrantry answered 28/12, 2013 at 23:56 Comment(0)
S
0

Follow below steps:

  • Open phpmyadmin
  • Select user account tab
  • Select "Edit Privileges" form root-localhost user account
  • Select change password and assign new password
  • Restart phpmyadmin.

If problem still exist then open C Drive > ( Your Local Server Folder, WAMP/MAMP/XAMPP ) > APPS > PHPMYADMIN > config.inc.php in editor and change line

$cfg['Servers'][$i]['password'] = '';

to

$cfg['Servers'][$i]['password'] = 'New password';
Sorgo answered 23/4 at 9:22 Comment(0)
U
-2

On the MySQL error page, where two pink coloured error panels are appeared, you can find a small button at right side there. click on it.

Undertrick answered 8/4, 2015 at 22:21 Comment(2)
How does this answer the question? Perhaps some detail and a screen shot would help...Continuous
Downvoted because @debika never followed up to clarify and the answer as it stands makes no senseBleachers

© 2022 - 2024 — McMap. All rights reserved.