Resetting the Root Password
I know it happens, because I've done it myself: You go to log in to MySQL as the root user and access is denied. You cannot remember the correct password or get a new password to work. Effectively you've locked yourself out of MySQL and all hope is lost. Luckily, there is an easy enough work-around when (or if) this does occur: You need to reset the root password.
Resetting an access password involves starting MySQL without the user/privilege system in use. Then anyone can access the database, make the alterations, and restart MySQL.
To reset the root password: