这个问题困扰了我一段时间,我在网上到处找答案,试了很多的办法,却并没有用
因为出现1067错误的可能原因有很多,
最好的办法就是检查错误日志
mysql的错误日志在data目录下的.error文件里面
2017-10-31 10:02:01 2236 [Note] Plugin 'FEDERATED' is disabled. 2017-10-31 10:02:01 2236 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-10-31 10:02:01 2236 [Note] InnoDB: The InnoDB memory heap is disabled 2017-10-31 10:02:01 2236 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2017-10-31 10:02:01 2236 [Note] InnoDB: Memory barrier is not used 2017-10-31 10:02:01 2236 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-10-31 10:02:01 2236 [Note] InnoDB: Not using CPU crc32 instructions 2017-10-31 10:02:01 2236 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2017-10-31 10:02:01 2236 [Note] InnoDB: Completed initialization of buffer pool 2017-10-31 10:02:01 2236 [Note] InnoDB: Highest supported file format is Barracuda. 2017-10-31 10:02:01 2236 [Note] InnoDB: 128 rollback segment(s) are active. 2017-10-31 10:02:01 2236 [Note] InnoDB: Waiting for purge to start 2017-10-31 10:02:01 2236 [Note] InnoDB: 5.6.24 started; log sequence number 1625977 2017-10-31 10:02:01 2236 [ERROR] C:Program FilesMySQLMySQL Server 5.6inmysqld: unknown option '-d'
error在最后一句:unknown option '-d'
意思是注册mysql服务是,命令错误
我的错误是:将“--defaults-file”写成了“-defaults-file”
解决方法1:windows下进入注册表,HKEY_LOCAL_MACHINE--SYSTEM-SERVICES--你的MYSQL服务名,找到KEY为“ImagePath”的选项,将里面的值改过来
解决方法2:卸载重装mysql,关于卸载mysql,如果是.msi的安装包安装的,只要重新开始安装,会有一个remove选项,这就是卸载了
将错误改过来之后,问题解决;mysql server 启动成功