First stop the MySQL service

Open the mysql configuration file - my.ini

Search [mysqld] and add a line below skip-grant-tables And save it.

MySQL can log in to the database without a password. Click MySQL Command Line Client to open the MySQL command line console.

A prompt of "Enter Password:" appears in the window. Press Enter to log in to the MySQL console.

Re enter Update user set password=password ('new password ') WHERE User='root'; Press Enter.