MYSQL RESET ROOT PASSWORD IN REDHAT

step:1.stop mysql database service.

sudo /etc/init.d/mysqld stop




step:2.open mysql safe mode use this command    

sudo mysqld_safe




step:3.   login to root user

mysql -u root





step:4.use any database .

use mysql;



 step.5.use this command

update user set authentication_string=PASSWORD('mynewpassword') where User='root';

flush privileges;

quit



step:6.stop mysql database service.

sudo /etc/init.d/mysqld stop

step:7.start mysql database service

sudo /etc/init.d/mysqld start


step.8. login to mysql use new password

mysql -u root -p

Comments

Post a Comment

Popular posts from this blog

MySQL Point in Time Recovery: How To Configure And How Does it Work?

MySQL Replication Switchover: Step-by-Step Guide

Mysql Commercial Mysqlbackup:How to take Differential or Incremental Backup and resotre using mysqlbackup utility in mysql 8.0.37 enterprise edition