Changing root password after initial mysql 5.7 install

It’s been a while since I’ve installed mysql, and it seems with most recent versions root is set a default password on install which you need to logon and change before you can do anything else.

Logon with:

mysql -u root -p

and enter the temporary password, then change the default with:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

This is described in the docs here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.