MYISAM数据库是我用的mysql,还不需要INNODB,所以打算不直接加载INNODB引擎。
Just add skip -innodb to my.ini (/etc/my.cnf under Linux).
我把这个设置好之后,在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,默认引擎设置为INNODB,我加了skip-innodb,怪不得启动不了。
Change the default storage engine to MYISAM, and start MYSQL!
在skip-innodb下,数据目录中的三个文件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
这三个文件不会自动生成。