This following line saved my butt when something happened and my root password was no longer working.
sudo dpkg-reconfigure mysql-server-5.0
It will allow you to reset your root password without messing with the data or any other configuration in my.cnf.