Claim your Biolink Click Here
2 like 0 dislike
287 views

How to RESETTING MYSQL ROOT PASSWORD [IN CASE we FORGOT PASSWORD]

in Education & Reference by (1.1k points) | 287 views

3 Answers

0 like 0 dislike
Best answer

run the below command

[root ~]#service mysqld stop
[root ~]#mysqld_safe --skip-grant-tables

open the server in a new session and open the mysql without the password

[root ~]# mysql
mysql>use mysql;

For MySQL < 5.5

mysql>update user set Password=PASSWORD('new-password') where user='root';
mysql>flush privileges;
mysql>exit;

For MySQL 5.7

mysql>update user set authentication_string=PASSWORD('new-password')  where user='root';
mysql>flush privileges;
mysql>exit;
by
selected by
0 0
update the below column too

set password_expired ='N'
0 like 0 dislike

run the below command

[root ~]#service mysqld stop
[root ~]#mysqld_safe --skip-grant-tables

open the server in a new session and open the mysql without the password

[root ~]# mysql

mysql>update user set Password=PASSWORD('new-password') where user='root';
mysql>flush privileges;
mysql>exit;
by
0 like 0 dislike

update the below column too

set password_expired ='N'

by

Related questions

1 like 0 dislike
1 answer
2 like 0 dislike
1 answer
0 like 0 dislike
1 answer
2 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Dec 13, 2018 in Education & Reference by Neha (1.1k points) | 369 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,312 questions
1,473 answers
569 comments
4,809 users