how to set root password mysql code example
Example 1: mysql set root password
use mysql;
update user set authentication_string=PASSWORD("mynewpassword") where User='root';
flush privileges;
quit
Example 2: how to change mysql localhost password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword'
Example 3: how to change mysql root password in windows 10
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';