产生背景:
之前在win7系统能正常运行,但今天重装系统,把c盘格式化了,在新系统运行mysql就报如下错误:
错误提示;
E:\mysql5.7\bin>mysqld --console
2018-04-15T14:57:12.199569Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-15T14:57:12.199569Z 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.
2018-04-15T14:57:12.199569Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2018-04-15T14:57:12.199569Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-15T14:57:12.199569Z 0 [Note] mysqld (mysqld 5.7.16) starting as process 5728 ...
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: Uses event mutexes
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: Number of pools: 1
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-15T14:57:12.215193Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-15T14:57:12.246939Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2018-04-15T14:57:12.246939Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2018-04-15T14:57:12.248940Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-04-15T14:57:12.457323Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-04-15T14:57:12.457497Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-04-15T14:57:12.460514Z 0 [ERROR] Failed to initialize plugins.
2018-04-15T14:57:12.462516Z 0 [ERROR] Aborting
2018-04-15T14:57:12.463517Z 0 [Note] Binlog end
2018-04-15T14:57:12.465519Z 0 [Note] Shutting down plugin 'CSV'
2018-04-15T14:57:12.467520Z 0 [Note] mysqld: Shutdown complete
解决方案:
1、打开任务管理器终止mysqld进程;2、打开mysql安装目录的data文件夹,删除以下2个文件:ib_logfile0和ib_logfile13、重新启动mysql
为什么?