How to change MySQL root username and password

Published on Author Code Father
How to change MySQL root username and password?

Step 1:

Connect MySQL

Step 2:

use mysql;
update user set user='admin' where user='root';
flush privileges;

Step 3:

Change the root user password

update user set password=PASSWORD('new password') where user='admin';
flush privileges;

Comments

comments