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;
With High Performance MySQL, you’ll learn advanced techniques for everything from designing schemas, indexes, and queries to tuning your MySQL server, operating system, and hardware to their fullest potential.
This guide also teaches you safe and practical ways to scale applications through replication, load balancing, high availability, and failover.