I've tried to change my root password for MySQL and only managed to block myself from entering MySQL. I used the following command:
/usr/local/mysql/bin/mysqladmin -u root password new-password -p
I was prompted for my password and I entered my old password with no error message. From then on I was locked out.