欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

MYSQL无法启动提示: Default storage engine (InnoDB) is not available的解决方法

程序员文章站 2023-12-14 23:19:22
在my.ini(linux下/etc/my.cnf)加上skip-innodb,就可以了。 我这样设置后,在linux下都没问题,今天在我本机winxp启动mysql,提示...
在my.ini(linux下/etc/my.cnf)加上skip-innodb,就可以了。
我这样设置后,在linux下都没问题,今天在我本机winxp启动mysql,提示启动不起来。看下mysql目录的错误日志:
引用
090613 10:15:27 [error] default storage engine (innodb) is not available
090613 10:15:27 [error] aborting

090613 10:15:27 [note] c:\www\mysql\bin\mysqld-nt: shutdown complete

估计是上次加了参数后,一直没启动起来。。。已经很久没用本机的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: the first specified data file .\ibdata1 did not exist:
innodb: a new database to be created!
090613 10:19:37 innodb: setting file .\ibdata1 size to 10 mb
innodb: database physically writes the file full: wait...
090613 10:19:37 innodb: log file .\ib_logfile0 did not exist: new to be created
innodb: setting log file .\ib_logfile0 size to 24 mb
innodb: database physically writes the file full: wait...
090613 10:19:38 innodb: log file .\ib_logfile1 did not exist: new to be created
innodb: setting log file .\ib_logfile1 size to 24 mb
innodb: database physically writes the file full: wait...
innodb: doublewrite buffer not found: creating new
innodb: doublewrite buffer created
innodb: creating foreign key constraint system tables
innodb: foreign key constraint system tables created
090613 10:19:39 innodb: started; log sequence number 0 0
090613 10:19:39 [note] c:\www\mysql\bin\mysqld-nt: ready for connections.


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

090613 10:30:12 [note] c:\www\mysql\bin\mysqld-nt: normal shutdown

090613 10:30:12 [note] c:\www\mysql\bin\mysqld-nt: shutdown complete

090613 10:30:17 [note] c:\www\mysql\bin\mysqld-nt: ready for connections.
version: '5.0.45' socket: '' port: 3306 source distribution

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

上一篇:

下一篇: