If you administer a server and have forgotten your MySQL password, do this sequence. Note that in Windows, if you've not added the MySQL's bin folder to the system path, you will have to navigate in the DOS window to that folder to execute these commands. If your MySQL version is earlier than 5.5.7, substitute password for authentication_string in what follows:1. Stop MySQL:
Win: Stop it in services.msc, or run ...
2. Start the MySQL server specifying your defaults-file (if you don't know that filename, see "What config file is the MySQL server using?"), and bypassing authentication ...
3. In another command window, start the mysql client:
4. Find the name of the admin user (probably 'root'; you cannot create users when running with skip-grant-tables), update that user's password:
-- reset authentication_string (password before 5.5.7) for the admin user ...
(Substitute your password for 'new_pass'.) 5. Stop mysqld in Task Manager or in another command window...
4. Restart MySQL: *Nix:
Win: restart the services in services.msc, or run ...
For more detail see http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html |