How to reset the password of mysql in centos ?

Hello All,

I have a server of  Centos   6.7  64 bit   operating system. i have installed  Mysql  in it.  I want to reset  the  password  of mysql .  How can we do ?

jamesnathon Supporter Asked on September 7, 2016 in Technology.
Add Comment
1 Answer(s)

Hello  All ,

[root@localhost]# /etc/init.d/mysqld stop

[root@localhost]# mysqld_safe –skip-grant-tables &

[root@localhost]# mysql -uroot

mysql> use mysql;

update user set password=PASSWORD(“mynewpassword”) where User=’root’;

flush privileges;


[root@localhost]#/etc/init.d/mysqld stop

[root@localhost]#/etc/init.d/mysqld start

[root@localhost]# mysql -u root -p

you will be promoted for password .

franklinneal Supporter Answered on September 14, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.