简体   繁体   中英

Access denied for user 'root'@'localhost' (using password: YES) after resetting root password

I am getting this when trying to load a webpage that requires the mysql database. I had to go and recently reset the root password that was used for phpmyadmin.

oops connection problem ! --> Access denied for user 'root'@'localhost' (using password: YES)

All this is also running on my Raspberry Pi 2.

I used the below command after these issues which only reset the root phpmyadmin password

sudo dpkg-reconfigure mysql-server-5.5

I can also log in to mysql by using

mysql -u root -p

I think you need to change the password in the configs of the webpage.

Please check your db credentials in the php page.

Remember:

If you include something that contains the db credentials you should change it there.

Open the cmd and type this command

sudo mysql -u root

MariaDB will open in cmd, now type the following query in the MariaDB

UPDATE mysql.user 
SET authentication_string = password('your_password_here'),    
    plugin = 'mysql_native_password' 
WHERE user = 'root';

FLUSH PRIVILEGES;

This works for me to enter into phpAdmin login page

Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM