Reset MySQL root password on Windows

Steps

  1. Open command line with administrator permission
  2. Stop mysql service (2 ways)
    1. net stop mysql
    2. administrator tools -> services
  3. Create a mysql_init.txt file with this command line:
    ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘new password’;
  4. cd C:\Program Files\MariaDB 10.3\bin
  5. mysqld –init-file=C:\\mysql-init.txt
  6. Done, password of root has been reset

Reference:

  1. https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/resetting-permissions-windows.html
  2. https://dev.to/oneearedmusic/access-denied-reset-mysql-root-user-password-2hk4