Access denied for user 'root'@'localhost' (using password: N

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Access denied for user 'root'@'localhost' (using password: N

Postby Rob_Again » 10. July 2022 09:49

Hi. I tried to logon to phpmyadmin and got this error
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

I have it setup as user='root' and no password.
Upon checking my config.inc.php file this is whats there
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';


and at the start of my.ini is
[client]
#password = my-password
port = 3306
socket = "C:/xampp/mysql/mysql.sock"


I am assuming that both are correct. (from what I have read)
I also read the you can put cookie in
$cfg['Servers'][$i]['auth_type'] = 'cookie';

and myphpadmin will ignore the values of "user" and" password". So I changed my config.inc.php file to
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'thepassword';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Lang'] = '';


and got error code
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

I have now changed it back to the settings as it was.

What else can I try. thanks
Rob_Again
 
Posts: 4
Joined: 27. July 2020 09:42
XAMPP version: 4.9.0.1
Operating System: Windows 10

Re: Access denied for user 'root'@'localhost' (using passwor

Postby Nobbie » 10. July 2022 16:42

Rob_Again wrote:I have it setup as user='root' and no password.


What do mean by "i have it setup"? A fresh Xampp installation does not need ANY setup and any configuration, it is configured totally correct out of the box. You MUST NOT change anything as long as you dont urgently need a change.

If you edited config.inc.php you may have done something wrong. Do you have a fresh Xampp installation or what do you have?

Rob_Again wrote:What else can I try


Delete c:/xampp and do a full fresh installation. And finally simply start Xampp, start a browser, enter http://localhost and finally click on "phpmyadmin" in the top menu.
Nobbie
 
Posts: 13233
Joined: 09. March 2008 13:04

Re: Access denied for user 'root'@'localhost' (using passwor

Postby Rob_Again » 11. July 2022 10:09

Sorry if I used the wrong wording... I put "I have set up" What I ment was I am running it as default setup... no changes.
I have now deleted that install of xammp.... and a lot of files I should not have.... however, after an afternoon of searching and playing I now have phpmyadmin and the databases I "lost" up and running again.
Rob_Again
 
Posts: 4
Joined: 27. July 2020 09:42
XAMPP version: 4.9.0.1
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 99 guests