InnoDB损坏
原来一切正常,但是近来mysql收到巨大的查询,经常导致服务器宕机,从昨天开始mysql的InnoDB不能使用,所有使用InnoDB引擎的数据库全部不能读取,刚开始以为数据库损坏,但是恢复备份以后依旧存在,同时mysql的my.cnf没有经过修改,默认是支持InnoDB的。
081011 19:40:01 mysqld started
InnoDB: Error: log file ./ib_logfile0 is of different size 0 268435456 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
081011 19:40:01 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.45-log' socket: '/var/lib/mysql/mysql.sock' port: 0 Source distribution
ib开头的日志文件按照网上大家说的清除过,但是无效,清除日志以后重启的日志如下
081011 19:53:58 mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
081011 19:53:58 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
081011 19:53:58 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
081011 19:53:58 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 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
081011 19:53:59 InnoDB: Started; log sequence number 0 0
081011 19:53:59 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.45-log' socket: '/var/lib/mysql/mysql.sock' port: 0 Source dist
ribution
但是再次重启依然会出现
InnoDB: Error: log file ./ib_logfile0 is of different size 0 268435456 bytes这样错误。
访问使用InnoDB的数据库会得到如下日志:
081011 19:54:54081011 19:54:54 [ERROR] Cannot find table wiki/page from the
internal data dictionary
of InnoDB though the .frm file for the table exists. Maybe you
have deleted and recreated InnoDB data files but have forgotten
to delete the corresponding .frm files of InnoDB tables, or you
have moved .frm files to another database?
See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
how you can resolve the problem.
服务器系统是centos 5.2 x86_64 内存2G 系统设置都是默认的。
x-comet
周一, 2008/10/13 - 01:09
Permalink
删除/var/lib/mysql/这个
删除/var/lib/mysql/这个目录已经 让系统自动初始化数据库 然后再恢复也不行
yejr
周一, 2008/10/13 - 09:19
Permalink
确认你修改的my.cnf是
确认你修改的my.cnf是可以发生作用的
贴上 ib_log_file* 的大小以及my.cnf中你设置的大小
MySQL方案、培训、支持
x-comet
周二, 2008/10/14 - 17:21
Permalink
my.cnf配置是默认的,
my.cnf配置是默认的,没有经过修改
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
顺便问一句,如何降低搜索引擎对mysql照成的瞬时压力?
yejr
周二, 2008/10/14 - 19:10
Permalink
我的意思是,你的my.c
我的意思是,你的my.cnf确定是发生作用的,也就是mysqld读取的是它,而不是其他目录下的my.cnf。不过你这问题是比较奇怪,如果能让我登录到现场,或许就能明白咋回事了,猜测是你哪个地方没搞明白或者误解了。
MySQL方案、培训、支持
x-comet
周五, 2008/10/17 - 23:34
Permalink
谢谢yejr关心,老久没
谢谢yejr关心,老久没有恢复 重做系统了
不过对于突然增大的访问 有没有方法缓解呢?
yejr
周日, 2008/10/19 - 22:23
Permalink
换或加更好的服务器
换或加更好的服务器 :)
MySQL方案、培训、支持