mysql报错--initialize specified but the data directory has files in it. Aborting.

Posted When you look into the abyss,

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql报错--initialize specified but the data directory has files in it. Aborting.相关的知识,希望对你有一定的参考价值。

初始化msyql时出现报错

C:mysql-5.7.19-winx64> C:mysql-5.7.19-winx64inmysqld --initialize-insecure
2019-12-25T01:59:21.234788Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-12-25T01:59:21.237781Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2019-12-25T01:59:21.239775Z 0 [ERROR] Aborting

 

原因是data文件夹已经创建

解决办法:删除该目录下的data文件夹,删除后重新执行该命令该文件夹会重新生成,成功初始化

 

以上是关于mysql报错--initialize specified but the data directory has files in it. Aborting.的主要内容,如果未能解决你的问题,请参考以下文章

MySQL主从报错解决:Failed to initialize the master info structure

MySQL5.7报错–initialize specified but the data directory has files

MySQL5.7报错–initialize specified but the data directory has files

服务器Mysql报错报错#2013 - Lost connection to MySQL server at 'reading initial communication packet

mysql报错--initialize specified but the data directory has files in it. Aborting.

MySQL复制报错(Slave failed to initialize relay log info structure from the repository)