Recover MySQL root password

Need to recover your MySQL database password from a Windows server?

At the command prompt type –
net stop mysql (your service name)

Find your my.ini and edit the my.ini file. Add the following  under [mysqld]
skip-grant-tables
Save

At the command prompt type –
net start mysql (your service name)
Change to the bin directory at a command prompt
mysql (hit enter)
UPDATE mysql.user SET PASSWORD=PASSWORD(‘yourpasswordhere’) WHERE user=’root’ AND host=’localhost’;
hit enter
exit
net stop mysql

Take out the line you added to your my.ini
Save your my.ini

At the command prompt type –
net start mysql (your service name)

Advertisements

About TCAT Shelbyville IT Department

The Tennessee College of Applied Technology - is one of 46 institutions in the Tennessee Board of Regents System, the seventh largest system of higher education in the nation. This system comprises six universities, fourteen community colleges, and twenty-six Applied Technology Colleges.
This entry was posted in Technology and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s