Recover MySQL root Password

MySQL is an open-source relational database management system(RDBMS).MySQL is a central component of the LAMP open-source web application software stack (and other "AMP" stacks). LAMP is an acronym for "LinuxApache, MySQL, Perl/PHP/Python". 

All My SQL databases on a server are always protected by a root password for better security. Server Administrator's have access to such information's for better troubleshooting of any issue. In case's where you forget the My SQL root password, you can use the following method to reset the My SQL root password.


# /etc/init.d/mysql stop 
# mysqld_safe --skip-grant-tables & 
# mysql -u root 
mysql> use mysql; 
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; 
mysql> flush privileges; 
mysql> quit
# /etc/init.d/mysql stop 
# /etc/init.d/mysql start 
# mysql -u root -p

No comments:

Post a Comment

Thank You.

https://linwintech.blogspot.com/