我已经坚持了很长时间,我尝试按照此处的说明进行操作:https ://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html 。当我运行命令时,我将其作为输出:
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.
我不知道从这里做什么,因为我不认为它在教程中。任何解决此问题的帮助将不胜感激。谢谢
因为没有显示错误(但是这个 2021-01-01T09:15:45.594^C297 看起来不正常!),您应该按照过程中所示继续下一步。
检查您的密码是否已更改。
如果您的密码没有更改,请创建一个简单的初始化文件(即与步骤 3 中建议的相同),然后重试。
如果您的密码已更改,请不要忘记删除
init-file
.编辑
:我按照程序重置了我的“root”密码。
此会话的所有输出都在这里,中间有一些注释:
首先我们注意到我们不知道密码:
然后创建一个 mysql-init.txt 文件:
然后我们停止 MySQL 服务器。我的服务器名为 MySQL80,但您也可以从服务窗口停止它(更多详细信息请点击此处)
密码重置:
现在服务器启动并输出到控制台,停止服务器类型 CTRL+C:
我们以正常方式(或通过服务)再次启动服务器:
我们尝试登录:
使用最后一条命令,可以将密码更改为“stackoverflow”。我相信任何读过这篇文章的人都能想到一个更好的密码。