XAMPP PhpMyAdmin Error 1045, "Access denied for user 'root'@'localhost'
Asked Answered
L

5

8

I see this question has been asked many times, but I don't find a solution for my problem. Tried all possible combinations in config.inc.php

$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapass';

I installed XAMPP. In PhpMyAdmin I modified the password of root@localhost. I am able to login to PhpMyAdmin using the new password.

But when I Add a new user Drupal as per drupal installation steps, I get this error:

Error 1045, "Access denied for user 'root'@'localhost' (Password: YES)

But still the drupal user gets created but the drupal database in mysql doesnt get created.

When I try to create drupal database separately I am able to do it.

Apart from this I tried MySQL.exe -u root -p. It works fine there, so I am not sure.

Luminescence answered 22/1, 2014 at 12:24 Comment(1)
try keeping password blankGooding
P
2

In the config.inc.php

edit

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

to

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

Then restart.

And some magic will happen!!

Phionna answered 27/1, 2016 at 21:58 Comment(0)
A
1

Try changing

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = '127.0.0.1';

Attenuation answered 22/1, 2014 at 12:52 Comment(1)
It was already '127.0.0.1', I changed it 'localhost'. Both does not work.Luminescence
N
0
$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

Nims answered 11/6, 2015 at 7:47 Comment(0)
M
0

1045 - access denied for user 'root'@'localhost' (using password yes)

I have tried everything but this is the best solution

Solution : Open xampp control panel config.inc.php

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

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

Work fine !!

Masticate answered 24/11, 2015 at 3:2 Comment(0)
P
0

Add the following in:

/opt/lampp/phpmyadmin/config.inc.php

Code:

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'admin';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Pedestrian answered 23/7, 2017 at 11:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.