There are times when you lose root mysql password, but you still have root access to the server. You will probably get an error something like this:
mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'
Reset it with the following steps