Coba ini:
mysql -u root -h 127.0.0.1 -p
Enter password: (enter the random password here)
Ref:https://dev.mysql .com/doc/refman/5.7/en/data-directory-initialization-mysqld.html
Setelah ini, Anda dapat menyetel ulang sandi menggunakanALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';