I'm sorry if the explanation is rough due to lack of knowledge.
I would appreciate your help.

I want to be able to login to mysql from a command prompt. (Unable to initialize password in windows environment,
(I have not been able to determine whether the password is wrong or mysql itself is broken due to file corruption etc.)

Error message

If i enter the following command to log in as a root user, an error message will be displayed
C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin>mysql -u root -p
Enter password:******
ERROR 1045 (28000): Access denied for user'root'@'localhost'(using password: YES)

cd to mysql bin to login without password and hit the following command to display error message ①
mysqld -nt --skip-grant-tables

mysqld: Can't change dir to'C: \ Program Files \ MySQL \ MySQL Server 5.7 \ data \'(Errcode: 2-No such file or directory)

Enter the following command to try to uninstall once, but Remove of the Service denied display
mysqld --remove mySQL57


Make sure MySQL version is displayed correctly
Check with the service that the MySQL57 service is running
netstat 3306 is in LISTENING state,
Check with Task Manager that the process ID is mysqld.exe.
The above problem occurs even if you try to uninstall once.

  • Answer # 1

    Refer to the following site and proceed with the work
    https://qiita.com/Nekonecode/items/c44896105f1c2b22630e#%E3%83%91%E3%82%B9%E3%83%AF%E3%83%BC%E3%83%89%E3%81%AA % E3% 81% 97% E3% 81% A7% E4% BD% BF% E3% 81% 88% E3% 82% 8B% E3% 83% A2% E3% 83% BC% E3% 83% 89% E3 % 81% A7mysql% E3% 82% 92% E8% B5% B7% E5% 8B% 95

  • Answer # 2

    mysql -u root -h -p
    What message do you get when you connect with

  • Answer # 3

    This page is a little old but

    [MySQL] How to deal with ERROR 1045