Changing the mysql root password is a pure mysql side stuff..
did you already tried with
mysqladmin -u root -p password 'yournewpasswd'
or with
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPasswd!';
the thing is that for the secon command you need to connect to mysql before issuing it. So, if you are not able to connect with root anymore....
another thing, does the new password contains some special char like = " < > etc.. ? i think those char are not supported on mysql side