How to change MySQL password

I found changing the MySQL requires a bit of strict approach (command line)

Here is the code to change MySQL password which is latest and works fine for me.

Open command window (terminal) and complete the following few commands

update user set password=PASSWORD('YOUR_NEW_PASSWORD') where User='root';
flush privileges;

The above command resets the password of root user to YOUR_NEW_PASSWORD