MySQL Forums
Forum List  »  Newbie

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Posted by: frank smith
Date: April 30, 2021 01:44PM

Hello,

This is my first post here. I am new to Mysql and Linux. I installed Nextcloud on a Raspberry Pi and its been running for 3 months or so now.

I was trying to install Mediawiki and needed to give permissions to the root user to install the database. I'm not sure what happened but now if I just run "sudo mysql" I get the "access denied for user 'root'@'localhost' (using password: YES)" error and can't do anything at all. It seems I am basically locked out of accessing mysql now?

-----------------------
My first attempt, I ran:
-----------------------

sudo mysql

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

-----------------------
My last attempt which then locked me out, I ran:
-----------------------


~ sudo su
~ mysql -u root -p
*enter your password*
~ update mysql.user set plugin = 'mysql_native_password' where User='root';
~ FLUSH PRIVILEGES;
~ exit;


Could anyone assist or point me to where I could find assistance on this?

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
April 30, 2021 01:44PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.