造成此情况的原因是mysqld --initialize运行失败,在data里会找到错误信息
2018-12-06T11:42:05.084257Z 0 [ERROR] [MY-000077] [Server] D:\ProgramData\MySQL-8.0.13\bin\mysqld.exe: Error while setting value 'NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER' to 'sql_mode'.
2018-12-06T11:42:05.087686Z 0 [ERROR] [MY-013236] [Server] Newly created data directory D:\ProgramData\MySQL-8.0.13\data is unusable. You can safely remove it.
2018-12-06T11:42:05.089305Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-06T11:42:05.090126Z 0 [Note] [MY-010120] [Server] Binlog end
以上是我的错误信息,我就将其注释掉了
或者其他的原因,可以用mysqld console查看
之后再从新运行mysqld --initialize
在data中出现以下内容表示成功
然后成功开启服务: