MySQL can't login and/or reset password There are many similar questions, but none of them helped me.

I had been using MySQL on Windows with root/root credentials for a while, but since lately, I'm not able to login

&gt; mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

&gt; mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

&gt; mysql -uroot -p
Enter password: ****
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

&gt; mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


I've tried to reset root password: (in admin console)

&gt; cat C:\mysql-init 
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';

&gt; mysqld --init-file=C:\mysql-init --console


but there is an error line:

2015-12-17T10:34:14.616701Z 1 [ERROR] 1131  You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords
Enable skip-grant-tables in my.ini and restart MySQL. Now root can login without password so that you can reset your password:

update mysql.user set password=password('newpassword') where user='root';