启动mysql服务时出现 发生系统错误 1067 的错误
首先去安装目录下的data文件夹下查看错误日志(.err)
内容如下:
2022-04-09T11:21:07.196708Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-04-09T11:21:07.196743Z 0 [System] [MY-013169] [Server] c:\Program Files\MySQL\mysql-8.0.28-winx64\mysql-8.0.28-winx64\bin\mysqld.exe (mysqld 8.0.28) initializing of server in progress as process 26636
2022-04-09T11:21:07.199131Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2022-04-09T11:21:07.256570Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-04-09T11:21:08.189968Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-04-09T11:21:09.776520Z 0 [ERROR] [MY-000068] [Server] unknown option '--C:\Program Files\MySQL\mysql-8.0.28-winx64\mysql-8.0.28-winx64'.
2022-04-09T11:21:09.777533Z 0 [ERROR] [MY-013455] [Server] The newly created data directory c:\Program Files\MySQL\mysql-8.0.28-winx64\mysql-8.0.28-winx64\data\ by --initialize is unusable. You can remove it.
2022-04-09T11:21:09.779375Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-04-09T11:21:11.730890Z 0 [System] [MY-010910] [Server] c:\Program Files\MySQL\mysql-8.0.28-winx64\mysql-8.0.28-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.28) MySQL Community Server - GPL.
我们主要是查看标识为[ERROR]的那几行。
例如第一个错误行显示
unknown option '--C:\Program Files\MySQL\mysql-8.0.28-winx64\mysql-8.0.28-winx64'.
无法识别的操作,然后后面是操作的内容,我们复制操作的内容(前面的–不需要复制),然后在安装目录下的my.ini文件(配置文件,名字不一定都是my.ini)查找对应出现的位置,
可以看到确实是格式有问题,少了一些东西,修改成如下形式就行了。
然后重新启动,发现还是报错,同样的错误。没办法,只能重新在bin目录命令行下允许mysqld --initialize
了。查看新生成的错误日志。
2022-04-09T11:53:07.501439Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.