Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

All I need is to be able to log in using root, but have forgotten the password. None of the steps to reset i found online work (i don't even have some of the executables mentioned such as mysql-nt.exe)

However I have no problem deleting all databases (i have scripts) and intallations and starting completely from scratch... but uninstalling and deleting directories doesn't work.

Thanks.


mysqld --skip-grant-tables --skip-networking

just gives me an error.. service won't start. For that matter the service won't start at all due to some unknown error (1067) even after I remove and reinstall... I think the only answer now is to buy a new laptop.

Thanks for trying.

share|improve this question

migrated from stackoverflow.com May 14 '10 at 16:36

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

If you just want to reset the root password, then do the following:

Stop the MySQL service.

go to the command prompt in your mysql bin folder run the following command

mysqld --skip-grant-tables --skip-networking

(skip-networking to stop remote connections.)

then use mysql command line tool and run the following script:

USE mysql;
UPDATE user set Password = PASSWORD('new-password') where User = 'root';

then stop the service by running

mysqld stop

restart the mysql service and login with your new password.

share|improve this answer
    
How is he going to start the MySQL command line tool if he forgot the root password? –  Hello71 Aug 11 '10 at 16:23
add comment

Open up windows services manager (start > run > services.msc > OK). Locate the MySQL service and note down its path (right click > properties > Path to executable). Once you note down the path, stop the service.

Now assuming that the path is C:\mysql\bin\mysqld run the command C:\mysql\bin\mysqld --remove. You can then remove the directories.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.