Skip to content


innodb_log_file_size的一个问题

备份一份mysql的数据到别的机器上的做法最简单的方案是先把运行的mysql关闭,然后把data目录下面的数据copy到别的机器上的mysql data文件夹下面去然后启动两边的mysql做主从备份。

如果数据库中有存在innodb表的话要注意innodb_log_file_size的问题。可能新的mysql启动会报这个错误

090225 23:50:08 [ERROR] /opt/lamp/apps/mysql/libexec/mysqld: Incorrect information in file: ‘./user/actor.frm’

主要是由于 原来的innodb_log_file_size新的参数不一致导致的。把这个参数改成原来的大小就OK了,当然还有其它的更好解决方案:
参考:
1.http://dev.mysql.com/doc/refman/5.0/en/adding-and-removing.html
2.http://qroom.blogspot.com/2007/03/incorrect-information-in-file.html

由于参考2文档需要要翻墙,把部分内容摘下:
=================
更改了innodb的日志文件大小,即innodb_log_file_size的值,重启mysql之后对innodb的表都会报错:[ERROR] /usr/local/mysql/bin/mysqld: Incorrect information in file: ‘./a/b.frm’。解决办法是修改其值后把日志文件ib_logfile删掉再启动mysql(请注意备份)。

注:删log之前确保innodb_fast_shutdown的值不是2,如果是2则需要先改为1,然后重启使之生效,再关闭mysql删log文件。其默认值是1。
=================

Posted in mysql, 技术.

Tagged with , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.