Thursday, April 30, 2015

How to reset mysql user password if forgot



1 => Create a temporary SQL text file, /tmp/temp.sql

 2 => Open /tmp/temp.sql file and write below query
 

SET PASSWORD FOR root@localhost = PASSWORD('New_password')

3 =>  Add below line in your MySQL config file (on Ubuntu this is on /etc/mysql/my.cnf), under the [mysqld] section: 
 
init-file=/tmp/temp.sql

4 > Now restart MySQL service after that check your mysql password has been reset

5 =>  Now remove the init-file=/tmp/temp.sql entry from my.cnf (do not forget this). Even as the server is up and running.

6 : =>  Remove the /tmp/temp.sql file.


Note : you can use this step for xampp also just use /opt/lampp/etc/my.cnf 



###################Enjoy ##########################

No comments:

Post a Comment

Installing Jenkins on RHEL 8 is a straightforward process. Here's a step-by-step guide

Introduction  Jenkins is an open-source automation server widely used for continuous integration (CI) and continuous delivery (CD) pipelines...