how to change root password in mysql alter user code example
Example 1: set password mysql
-- In case the UPDATE command returns "Column 'Password' is not updatable" run
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword';
flush privileges;
Example 2: mysql set password for user
# `SET PASSWORD FOR <user> = PASSWORD('<plaintext_password>')` is deprecated
SET PASSWORD FOR <user> = '<plaintext_password>';
FLUSH PRIVILEGES;