ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I installed MySql server for a class, when I attempt to connect to the server the following error message appear:
---------------------------------------------------------------------------
PS C:\WINDOWS\system32> mysql -u root -p
Enter password: hinreIsThePassword
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
---------------------------------------------------------------------------
I tried to follow these steps in this website:
https://www.artfulsoftware.com/infotree/tip.php?id=784&r=1
but when I did the third step the following error appears:
---------------------------------------------------------------------------
PS C:\WINDOWS\system32> mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 8.0\my.ini" --skip-grant-tables
2020-02-23T19:33:01.744483Z 0 [ERROR] [MY-000077] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Error while setting value 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'.
2020-02-23T19:33:01.828579Z 0 [ERROR] [MY-010187] [Server] Could not open file 'C:\MySQLData\DESKTOP-1SE2QHN.err' for error logging: Permission denied
2020-02-23T19:33:01.836795Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-02-23T19:33:01.836867Z 0 [Note] [MY-010120] [Server] Binlog end
---------------------------------------------------------------------------
When I installed MySql I had to create the "my.ini" file but it doesn't help me anyway, What I should do?