Reset root password in MySQL
IITDU Forum :: TechTalks :: Ubuntu
Page 1 of 1 • Share •
Reset root password in MySQL
Today my friend Jobaer asked me to help him reset his password in mysql. He apparently forgot what his password was. And he tried in many ways to reset/change it. None worked. So I decided to give a look.
After a while, I found exactly how to reset mysql password
The steps are:
Stop MySQL server.
Start MySQL Daemon with grant table skipping.
Login to MySQL server using username root
now, get inside mysql database where user information is kept.
After that, simply change the password using this command:
Now, flush privileges
And then, restart mysql server.
Test your mysql Password:
when asked, enter your new password
After a while, I found exactly how to reset mysql password
The steps are:Stop MySQL server.
- Code:
sudo /etc/init.d/mysql stop
Start MySQL Daemon with grant table skipping.
- Code:
sudo mysqld_safe --skip-grant-tables &
Login to MySQL server using username root
- Code:
mysql -u root
now, get inside mysql database where user information is kept.
- Code:
use mysql;
After that, simply change the password using this command:
- Code:
update user set password=PASSWORD("NEW-PASSWORD") where User='root';
Now, flush privileges
- Code:
flush privileges;
And then, restart mysql server.
- Code:
/etc/init.d/mysql stop
/etc/init.d/mysql start
Test your mysql Password:
- Code:
mysql -u root -p
when asked, enter your new password

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.
|About me|My Blog|

BIT0122-Amit- Founder

- Course(s):
- BIT
Blood Group: O+
Posts: 4187
Points: 6601

IITDU Forum :: TechTalks :: Ubuntu
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Active Topics!

» Understanding Timestamp Based Protocol
» Hi from Newbie
» Compare an image from a list of images in the sql database....tell which image is matching
» Sending email without email ID
» teach yourself c by herbert schildt pdf
» .NET MVC3: Unable to find the requested .Net Framework Data Provider. It may not be installed.
» SAD Slides: 4.1, 4.2
» QA topic Presentation - Urgent Notice