MySQL Server 5.7
mysql-init.txt file (ALTER USER \'root\'@\'localhost\' IDENTIFIED BY \'test\';)
mysqld --init-file=C:\\mysql-init.txt
Tried using this