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

An error occurred while initializing msyql

C:\mysql-5.7.19-winx64> C:\mysql-5.7.19-winx64\bin\mysqld --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

 

The reason is that the data folder has been created

Solution: Delete data files in the directory folder, re-execute the command after deleting the folder will be regenerated successfully initialize

 

Guess you like

Origin www.cnblogs.com/z-x-y/p/12095838.html