HowTo: Change a User’s Password in MySQL

Changing a MySQL user’s password is a task handled by the database administrator (root).

Once the MySQL user’s password is changed, you should update the user’s privileges.

Step 1: Log into MySQL server as root

$ mysql -u root -p

Step 2: Use ‘mysql’ database

mysql> use mysql;

Step 3: Change password for user John

mysql> update user set password=PASSWORD('NEW-PASSWORD-HERE') where User='John';

Step 4: Reload privileges

mysql> flush privileges;