How To Reset Your MySQL or MariaDB Root Password

Change the root password.

For MySQL 5.7.6 and newer as well as MariaDB 10.1.20 and newer, use the following command.

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

Comments