Check out example codes for "change mysql password from command line". It will help you in understanding the concepts better.

Code Example 1

ALTER USER 'root'@'localhost' IDENTIFIED BY 'New-Password';

Code Example 2

# `SET PASSWORD FOR <user> = PASSWORD('<plaintext_password>')` is deprecated
SET PASSWORD FOR <user> = '<plaintext_password>';
FLUSH PRIVILEGES;

Learn ReactJs, React Native from akashmittal.com