Troubleshoot the Error “Access denied for user ‘root’@’localhost’ (using password: Yes)”
Cannot connect: invalid settings.
mysqli_real_connect(): (HY000/1045): Access denied for user
‘root’@’localhost’ (using password: YES)

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection.
You should check the host, username, and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Retry to connect.

so let’s start.
First of all, make sure that the XAMPp server is running if it is not running, start the server.
open xampp control panel go to MySQL config – click and open my.ini
now here we are going to paste command in skip section
copy and paste the same command

skip-grant-tables=TRUE

Save and close the file. restart MySQL and refresh localhost/phpmyadmin and here its solved this is just 1st step.
But it’s not resolved 100% yet we need one more setting.

If you have lost the password of your MySQL.

To change the MySQL/MariaDB root password, follow these steps:
Open your Windows command prompt by clicking the “Shell” button in the XAMPP control panel.

Again go to xampp control panel access shell and here just enter the command.

mysql -u root -p

Then it will directly login into your MariaDB.
If a password has already been previously set and you’d like to change it to a new one, you can use the following syntax:

UPDATE mysql.user SET Password=PASSWORD(‘222′) WHERE User=’root’;

Replace this root with your new password so
here we have changed our php MySQL password successfully.

Now we need to update the password into config.ini.php in xampp so open your xampp folder go to the file edit and into password enter a password which you have set in the shell. save and close.

Now open the my.ini file and delete the skip command which we have pasted in 1st step.save and close. Refresh your localhost.

from now you never face such error again while login into phpmyadmin.
———————————————————————–
Here are important steps that must be followed carefully & Commands used in this video.

skip-grant-tables=TRUE
mysql -u root -p
UPDATE mysql.user SET Password=PASSWORD(‘222′) WHERE User=’root’;

Make sure to restart mysql after any changes.
Don’t forget to removing the inserted line and restart mysql again.
======================================================

Nguồn:https://madisonrep.org/

Xem Thêm Bài Viết Khác:https://madisonrep.org/cong-nghe

23 Comments

Roberto Grijalva

January 25, 2020

La conexion al realizar consultas es lento, alguna manera para poder aumentar la velocidad?

Reply

Muazzam Khokhar

January 25, 2020

Thanks its really work.

Reply

cabdilaahi mahdi

January 25, 2020

thnx it helps me tomorrow is my project exam and i forget the xampp password it help me more love

Reply

uroborosep07

January 25, 2020

me resolvio el problema gracias a este video

Reply

Kamil Malak

January 25, 2020

i love you <3

Reply

W. Gabriel Henriquez

January 25, 2020

GRACIAS means THANK YOU

Reply

zamroot siyam

January 25, 2020

thanks you jeee

Reply

Mike

January 25, 2020

I'm having the issue on a live server. How do I handle it?
Thanks for replying.

Reply

Boom gard

January 25, 2020

it is work, thank you

Reply

Alvaro Céspedes

January 25, 2020

Gracias, en efecto al probar skip-grant-tables=TRUE, funciono.

Ty.

Reply

Civil Viking

January 25, 2020

Thank the good lord, the only REAL solution on the internet.

Reply

Kiobc

January 25, 2020

Mil gracias me funciono, merecido like 😀

Reply

Result Lol

January 25, 2020

ERROR 1348 (HY000): Column 'Password' is not updatable , help please

Reply

Juan Rico

January 25, 2020

Very, very, very thank you, this really solved my problem… CRACK

Reply

Silva Muzembe

January 25, 2020

thenks for your help

Reply

KAYVIA TELEVISION

January 25, 2020

my files are hosted on a live server….. what do i do?

Reply

Marc T

January 25, 2020

that worked great…thanks

Reply

Shimul Rahman

January 25, 2020

Thank you so much for your good job ! It`s very helpful for me.

Reply

Pratiksha Patnaik

January 25, 2020

Thank you. It worked for me

Reply

Gaurav Choudhary

January 25, 2020

Thank you so so much!!

Reply

JTechpreneur

January 25, 2020

Daaamn! After a 2hr hustle online to solve the issue, yours worked perfectly! Thanks

Reply

atta 2055

January 25, 2020

You Win This From Google Search Engine i had Tried so many searches but i was filed to find but you just solve Our Problem Just In 1 minutes Thanks A lot

Reply

Marian Alexandru

January 25, 2020

After I enter rhe command: UPDATE mysql.user SET Password=PASSWORD('admin123') WHERE User='root'; I get this error in xampp cmd : Table 'user' is marked as crashed and should be repaired. What should I do to get this working?

Reply

Leave a Reply