Monday 8 August 2016

Resetting mysql root password

Step 1

Stop the service of mysqld

service mysqld stop

or

/etc/init.d/mysqld stop

Step 2

connect the mysql to safe mode with following command

mysqld_safe --skip-grant-tables &

now we are in safe mode

Step 3

login as root user with following command

mysql -uroot


Step 4

now provide the following steps 

use mysql;

update user set authentication_string=password('12345') where user='root';

flush privileges;

quit

Step 5

Now stop the safe mode with following command restart the mysql

service mysqld stop  -  it will stop from safe mode

service mysqld start

Step 6

Login with root

mysql -u root -p



That's all all the best ....


No comments:

Post a Comment

Permanent hostname setup for RHEL7

Step 1 Set the host name on NMTUI tool like following nmtui set host name   then save and exit Step 2 add the following l...