Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 425
Kripa Avatar asked Jan 22 '14 12:01

Kripa


People also ask

How do I fix MySQL error Access denied for user root localhost?

Use the ALTER USER command and change the authentication method to log into MySQL as root: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'insert_password'; This command changes the password for the user root and sets the authentication method to mysql_native_password.

How do I fix error 1045 28000 Access denied?

Set root user password Login as user root with blank password >mysql -u root mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'abc';


1 Answers

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!!

like image 159
McAkinyi Adams Avatar answered Oct 18 '22 03:10

McAkinyi Adams