在显示安装成功MySQL后,初始化mysqld --initialize报错,错误显示如下
2023-04-03T709:05:28.842980Z O[Warning] TMESTAMP with implicit DEFAULT walue is deprecated.Please use -explicit_lefatlts_for_timestamp server option (see documentation for more details).
2023-04-03T09:05:28.8430327O [Warning] 'NO_ZERO_DATE', ‘NO_ZBRO _TN DATE' and 'ERROR FOR DIVISIO0N BY_EAo’sgql modes sthould be used with strict mode. They will be merged with strict mode in a future release.
2023-04-03TO9:05:28.843036Z 0[Warning] 'NO_AUTO_CREATE_USER’sql mode was not set.
2023-04-03T09:05:28.8484282 0 [BRROR] ~--initialize specified but the data directory has files in it.Aborting.2023-04-03T09: 05:28.848925Z 0[ERROR] Aborting
报错大致意思是所在数据文件夹不为空
解决方法:打开MySQL安装目录,在mysql-5.7.41-winx64目录下有一个data文件夹,把整个data删除,再重新mysqld --initialize初始化,会得到一个新的data,接着输入net start mysql启动成功
该报错的可能原因:之前安装过MySQL,没删干净,导致初始化数据库时data还有之前的数据
来源地址:https://blog.csdn.net/m0_50971744/article/details/129935308