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 also tried to connect to the server via Workbench but the same error appears (ERROR 1045 (28000))
Then I tried to follow these steps in this website: artfulsoftware
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
I' using MySQL server version 8.0.19 on windows 10
I uninstalled the apache service, reinsalled MySQL server and tried RiggsFolly's suggestion in the comment:
and it worked.
I also used a shorter password when I reinstalled MySQL.