--initialize specified but the data directory has files in it. Aborting. 问题解决

在这里插入图片描述
当电脑输入这条命令以试图初始化数据库的时候,出现这样的错误。

2023-10-23T09:04:21.258180Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-10-23T09:04:21.258237Z 0 [Warning] '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.
2023-10-23T09:04:21.258241Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2023-10-23T09:04:21.260667Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2023-10-23T09:04:21.261250Z 0 [ERROR] Aborting

后面我上网上查,再结合我自身的情况进行分析才知道,是我原来的MySQL删除不干净,但一时半会儿又不知道怎么删除,只能在安装目录里面新建一个data文件夹了
--initialize specified but the data directory has files in it. Aborting. 问题解决_第1张图片
然后,我在my.ini文件对data文件进行修改
--initialize specified but the data directory has files in it. Aborting. 问题解决_第2张图片
最后错误也是解决了

你可能感兴趣的:(bug解决,mysql)