zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

MYSQL无法启动提示:Defaultstorageengine(InnoDB)isnotavailable的解决方法

mysql方法 解决 启动 无法 提示 InnoDB
2023-06-13 09:14:28 时间
在my.ini(linux下/etc/my.cnf)加上skip-innodb,就可以了。
我这样设置后,在linux下都没问题,今天在我本机winXP启动MYSQL,提示启动不起来。看下mysql目录的错误日志:
引用
09061310:15:27[ERROR]Defaultstorageengine(InnoDB)isnotavailable
09061310:15:27[ERROR]Aborting

09061310:15:27[Note]C:\www\mysql\bin\mysqld-nt:Shutdowncomplete

估计是上次加了参数后,一直没启动起来。。。已经很久没用本机的mysql了。
查了下,原来my.ini里有一句:default-storage-engine=INNODB,把默认的engine设为INNODB,而我又加了skip-innodb,怪不得启不来了。

将default-storage-engine改为MYISAM,MYSQL启动OK!
在skip-innodb下,data目录下的ibdata1,ib_logfile0,ib_logfile1这三个文件就不需要了,就可以删除。

测试了下,在没加skip-innodb时,删除了这三个文件,启动时会自动创建这三个文件,日志如下:
引用
InnoDB:Thefirstspecifieddatafile.\ibdata1didnotexist:
InnoDB:anewdatabasetobecreated!
09061310:19:37InnoDB:Settingfile.\ibdata1sizeto10MB
InnoDB:Databasephysicallywritesthefilefull:wait...
09061310:19:37InnoDB:Logfile.\ib_logfile0didnotexist:newtobecreated
InnoDB:Settinglogfile.\ib_logfile0sizeto24MB
InnoDB:Databasephysicallywritesthefilefull:wait...
09061310:19:38InnoDB:Logfile.\ib_logfile1didnotexist:newtobecreated
InnoDB:Settinglogfile.\ib_logfile1sizeto24MB
InnoDB:Databasephysicallywritesthefilefull:wait...
InnoDB:Doublewritebuffernotfound:creatingnew
InnoDB:Doublewritebuffercreated
InnoDB:Creatingforeignkeyconstraintsystemtables
InnoDB:Foreignkeyconstraintsystemtablescreated
09061310:19:39InnoDB:Started;logsequencenumber00
09061310:19:39[Note]C:\www\mysql\bin\mysqld-nt:readyforconnections.


再删除这三个文件,加了skip-innodb后,启动日志:
引用

09061310:30:12[Note]C:\www\mysql\bin\mysqld-nt:Normalshutdown

09061310:30:12[Note]C:\www\mysql\bin\mysqld-nt:Shutdowncomplete

09061310:30:17[Note]C:\www\mysql\bin\mysqld-nt:readyforconnections.
Version:"5.0.45"socket:""port:3306Sourcedistribution

那三个文件就不会自动产生了。