1

I have been stuck on this for a long time, I tried to follow the instructions located here: https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html. When I run the commands I get this as my output:

2021-01-01T09:15:04.445377Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.22) starting as process 19920
2021-01-01T09:15:04.487135Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-01-01T09:15:04.901676Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-01-01T09:15:05.135403Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2021-01-01T09:15:05.240496Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-01-01T09:15:05.242979Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-01-01T09:15:05.325105Z 0 [System] [MY-010931] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: ready for connections. Version: '8.0.22'  socket: ''  port: 3306  MySQL Community Server - GPL.
2021-01-01T09:15:45.594^C297Z 0 [System] [MY
-013105] [Server] C:C:\Program Files\MySQL\MySQL Server 8.0\bin>\Pro
gram Files\MySQL\MC:\Program Files\MySQL\MySQL Server 8.0\bin>ySQL Server 8.0\bin\mysqld.exe: Normal shutdown.
2021-01-01T09:15:46.281364Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.22)  MySQL Community Server - GPL.
mysqld --init-file=C:\Users\user\text.txt --console
2021-01-01T09:15:51.297226Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.22) starting as process 21652
2021-01-01T09:15:51.320019Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-01-01T09:15:51.784233Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-01-01T09:15:52.015722Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2021-01-01T09:15:52.118175Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-01-01T09:15:52.126894Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-01-01T09:15:52.205977Z 0 [System] [MY-010931] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: ready for connections. Version: '8.0.22'  socket: ''  port: 3306  MySQL Community Server - GPL.

I am not sure what to do from here because I do not think it is on the tutorial. Any help solving this would be very appreciated. Thank you

1
  • Because no errors are shown (But this 2021-01-01T09:15:45.594^C297 does not look OK!), you should proceed with the next step as shown in the procedure, and do a check if your password is changed. If your password is not changed, please create a simple init-file (i.e. the same as is suggested in step 3), and try again.
    – Luuk
    Commented Jan 1, 2021 at 11:00

1 Answer 1

1

Because no errors are shown (But this 2021-01-01T09:15:45.594^C297 does not look OK!), you should proceed with the next step as shown in the procedure.

Do a check if your password is changed.

If your password is not changed, please create a simple init-file (i.e. the same as is suggested in step 3), and try again.

If your password is changed, then do not forget to delete the init-file.

EDIT

: I did a reset of my 'root' password following the procedure.

All output of this session is here, with some NOTE's in between:

First we notice that we do not know the password:

C:\Program Files\MySQL\MySQL Server 8.0>mysql -u root -p
Enter password: *******
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

C:\Program Files\MySQL\MySQL Server 8.0>

Then a mysql-init.txt file is created:

C:\Program Files\MySQL\MySQL Server 8.0>type mysql-init.txt
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

Then we stop the MySQL server. My server is name MySQL80, but you can also stop it from the services window (more details here)

C:\Program Files\MySQL\MySQL Server 8.0>net stop MySQL80
The MySQL80 service is stopping.
The MySQL80 service was stopped successfully.

Password reset with:

  • Note the double \\ in the path names, and the " surrounding the complete path
  • My default settings for MySQL are located here "D:\MySQL Server 8.0\my.ini", this is almost sure different at your location
    C:\Program Files\MySQL\MySQL Server 8.0>bin\mysqld.exe --defaults-file="D:\\MySQL Server 8.0\\my.ini" --init-file="C:\\Program Files\\MySQL\\MySQL Server 8.0\\mysql-init.txt" --console
    2021-01-01T18:51:09.333120Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
    2021-01-01T18:51:09.333840Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.22) starting as process 21888
    2021-01-01T18:51:09.341869Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
    2021-01-01T18:51:09.908748Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
    2021-01-01T18:51:10.083573Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
    2021-01-01T18:51:10.143779Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
    2021-01-01T18:51:10.144078Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
    2021-01-01T18:51:10.192745Z 0 [System] [MY-010931] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: ready for connections. Version: '8.0.22'  socket: ''  port: 3306  MySQL Community Server - GPL.

Now the server is started with output to console, to stop the server type CTRL+C:

2021-01-01T18:51:20.697066Z 0 [System] [MY-013105] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Normal shutdown.
^C
C:\Program Files\MySQL\MySQL Server 8.0>2021-01-01T18:51:21.447960Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.22)  MySQL Community Server - GPL.

We start the server again, the normal way (or via services):

C:\Program Files\MySQL\MySQL Server 8.0>net start mysql80
The MySQL80 service is starting.
The MySQL80 service was started successfully.

And we try to logon:

C:\Program Files\MySQL\MySQL Server 8.0>mysql -u root -pMyNewPass
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.22 MySQL Community Server - GPL

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> alter user 'root'@'localhost' IDENTIFIED BY 'stackoverflow';

With this last command the password can be changed to 'stackoverflow'. I am sure any who read this can think of a better password.

4
  • Hello, I tried what you said but everytime I run mysql -u root -p and enter a password I get ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES). I am not quite sure what I'm doing wrong.
    – K. Lok
    Commented Jan 1, 2021 at 16:01
  • If you followed the steps, you should be able to log on with the password MyNewPass. Maybe provide the command you used (they are in the procedure) but clearly something is done different then is explained there.... (BTW: after the password reset, you could also do mysql -u root -pMyNewPass (no space between -p and the password))
    – Luuk
    Commented Jan 1, 2021 at 16:12
  • I'm not sure what is happening that's different from the instructions, I get the error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) when trying.
    – K. Lok
    Commented Jan 1, 2021 at 17:44
  • I added the procedure step by step, and did not find any errors in it, so maybe the notes will be of help.
    – Luuk
    Commented Jan 1, 2021 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.