官方文档:
innodb_log_files_in_group
The number of log files in the log group. InnoDB writes to the files in a circular fashion. The default (and recommended) value is 2.
当我直接修改my.cnf将该参数改为3的时候
重启mysql,报错,innodb引擎无法挂载
110124 14:06:23 InnoDB: Log file ./ib_logfile2 did not exist: new to be created 110124 14:06:23 [ERROR] Plugin 'InnoDB' init function returned error. 110124 14:06:23 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Saver ——pkman110@msn.com 说 (14:29): *innodb_log_files_in_group 这个参数在初始化系统之后就不能调整了? Popgo 说 (14:31): *可以的 *你要先把原来的log备份下 Saver ——pkman110@msn.com 说 (14:31): *然后删了? Popgo 说 (14:32): *不是啊 Saver ——pkman110@msn.com 说 (14:32): *那咋搞 Popgo 说 (14:32): *把原来的log文件备份,把innodb_log_files_in_group变成你需要的。让数据重新生成log文件
调整方式:
1.停止服务
1036 service mysqld stop 2.移走当前的日志文件 1038 mkdir bak 1039 cd bak 1040 cd .. 1041 mv ib_logfile* ./bak/ 3.在my.cnf中修改参数数值
4.启动服务 1043 service mysqld start
系统处理日志
110124 14:44:55 mysqld_safe Starting mysqld daemon with databases from /data/mysql 110124 14:44:55 InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 512 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 300 400 500 110124 14:45:00 InnoDB: Log file ./ib_logfile1 did not exist: new to be created InnoDB: Setting log file ./ib_logfile1 size to 512 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 300 400 500 110124 14:45:05 InnoDB: Log file ./ib_logfile2 did not exist: new to be created InnoDB: Setting log file ./ib_logfile2 size to 512 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 300 400 500 InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 110124 14:45:10 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... InnoDB: Last MySQL binlog file position 0 793029012, file name ./mysql-bin.000048 110124 14:45:12 InnoDB: Started; log sequence number 136 3284391948
|