Check out example codes for "alter user root mysql". It will help you in understanding the concepts better.
Code Example 1
-- In case the UPDATE command returns "Column 'Password' is not updatable" run
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword';
flush privileges;
Code Example 2
ALTER USER 'root'@'localhost' IDENTIFIED BY 'New-Password';
Code Example 3
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword';
Learn ReactJs, React Native from akashmittal.com