In this video we describe “mysql -u root
ERROR 1698 (28000): Access denied for user ‘root’@’localhost’ ”
we give three solution to solve this error
Steps involved in this process are given below

HOW TO SOLVE THIS ERROR

SOLUTION 1:
sudo mysql -u root

SOLUTION 2:
STEP 1:
LOGIN USING: sudo mysql -u root
STEP 2:
CREATE A NEW USER WITH ALL PRIVILEGES FOR ALL DATABASES OR THE PARTICULAR DATABASE
A. create database subject
B. grant all on subject.* to [email protected] identified by ‘secret’;

STEP 3:
CHECK THE USER IS CREATED OR NOT
select user,host,plugin from mysql.user;
user1 | localhost | mysql_native_password

STEP 4:
TRY TO LOGIN USING mysql -u user1 -p
working

SOLUTION 3:
HOW TO LOGIN USING mysql -u root without using sudo

STEP 1:
sudo mysql -u root
STEP 2:
select user,host,plugin from mysql.user ;
STEP 3:
UPDATE auth_socket BY mysql_native_password
STEP 4:
update mysql.user set plugin=’mysql_native_password’ where user=’root’ and host=’localhost’;

STEP 5:
flush privileges;
STEP 6:
LOGIN USING mysql -u root without sudo

NOW WORKING
THANK U FOR WATCHING MY VIDEOS
IF U LIKE MY VIDEOS
PLS SUBSCRIBE
THANK U

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

7 Comments

gada DEV

February 25, 2020

thanks you so much !

Reply

Amanda Cassar

February 25, 2020

THANK YOU SO MUCH!!!

Reply

gamer x

February 25, 2020

Hi ! is this only for pc user? or does it work to android phone ? thank you for the reply

Reply

Mahmoud Tawfeek

February 25, 2020

sudo is not working with me

Reply

Kevin Caballero

February 25, 2020

Nice video, work perfectly. !!!

Reply

Csaba Nyírő

February 25, 2020

Thank you sooooooo much!!!!! I was like, okay, I’m done, I can’t solve it, but then I tried to solve this problem even harder. And that was my big luck! I tried to do the third solution, because I wanted to use the root, and I’m so happy! Thank you so much again!!

Reply

prasad Kadu

February 25, 2020

thank you man so much i am trying to solve the mysql access problem from 2hrs…

Reply

Leave a Reply