Forgot mysql root password ? No worries here is how I reset mine on by debian 9 Box.Usually it boils down to starting service
in safe mode & updating password & then restrating it normally.
in safe mode & updating password & then restrating it normally.
Here are the steps
1) First Stop mysql service
sudo service mysql stop2) Start mysql in safe mode
sudo mysqld_safe –skip-grant-tables3) In Another Terminal login as root mysql user no password needed
mysql -u root4) Update your root password using SQL Query for that first switch to mysql database which stores login and password.
use mysql;5) Update password
update user set password=PASSWORD(‘your_password_goes_here’) where where User='root';6) Ask Mysql to reload previlages to make changes take effect
flush privileges;7) Now time to test if change:
we made are working fine first exit from mysql command prompt by issuing 'exit'.also close the mysql running in safe mode by going to corresponding terminal & pressing "control + c" until it stops.8) Lets start mysql in normal way using service dameon
sudo service mysql startOnce service is up try to login through command line use password you just assigned.
mysql -u root -p
it works !
No comments:
Post a Comment