今天由于一些原因需要把mysql删除了然后重新安装,但是重新安装mysql之后无法重启了,下面我把我的解决办法分享给各位同学,希望对大家有所帮助.
Linux下mysql重装后无法重启解决办法
之前装的mysql5.1,但是经过系统还原后服务没有了,干脆升级到5.5,但是安装好了,配置时最后一步就是启动不了.
查看日志:programdata/data/pc.err发现:
- 11112122:16:50InnoDB:Logfile.ib_logfile0didnotexist:newtobecreated
- InnoDB:Settinglogfile.ib_logfile0sizeto10MB
- InnoDB:Databasephysicallywritesthefilefull:wait…
- 11112122:16:50InnoDB:Logfile.ib_logfile1didnotexist:newtobecreated
- InnoDB:Settinglogfile.ib_logfile1sizeto10MB
- InnoDB:Databasephysicallywritesthefilefull:wait…
- 11112122:16:50InnoDB:Cannotinitializecreatedlogfilesbecause
- 11112122:16:50InnoDB:datafilesarecorrupt,ornewdatafileswere
- 11112122:16:50InnoDB:createdwhenthedatabasewasstartedprevious
- 11112122:16:50InnoDB:timebutthedatabasewasnotshutdown
- 11112122:16:50InnoDB:normallyafterthat.
- 11112122:16:50[ERROR]Plugin‘InnoDB’initfunctionreturnederror.
- 11112122:16:50[ERROR]Plugin‘InnoDB’registrationasaSTORAGEENGINEfailed.
- 11112122:16:50[ERROR]Unknown/unsupportedstorageengine:INNODB--phpfensi.com
- 11112122:16:50[ERROR]Aborting
在网上一查,原来要将ib_logfile0,ib_logfile1,还有ibdata1这三个文件删掉才行,它们分别在data和programdata目录中(在配置时由你指定的).
windows下mysql重装后无法重启解决办法
解决方法:
1: 先卸载mysql,手动将其安装目录里没有删除干净的文件全部删除.
2: 将C:/ProgramData/MySQL 里有关mqsql的文件全部删除.
3: 重新安装 mysql 程序.
mysql服务就可以正常启动了.