How to Change MySQL User Password
To change the password of an existing MySQL user, you'll need to log into the MySQL server and run the
ALTER USER command. Let's go through each step.
From the terminal log into the MySQL server as
root, supplying any required passwords:
mysql -u root -p
Now run the following command, replacing
user_name with your username and
NEW_USER_PASSWORD with your password:
ALTER USER 'user_name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';
Now flush privileges to ensure the changes are applied.