分类: Mysql/postgreSQL
2011-11-10 15:56:21
使用的innodb,检查你的my.cnf或my.ini,里面会有一个参数innodb_force_recovery,
你看看他的值,默认是没有这个参数,没有的话,他的默认值是0,这个参数的值如果
大于0,innodb会被禁止使用insert、update、delete命令,你可以尝试将他的值设置
为0,看看你的mysql是否正常,如果正常就用就行了。
This variable should be set greater than 0 only in an
emergency situation when you want to dump your tables from a
corrupt database! As a safety measure,
InnoDB prevents any changes to its data
when this variable is greater than 0.
The database must not otherwise be used with any nonzero value of innodb_force_recovery. As a safety measure, InnoDB prevents users from performing INSERT, UPDATE, or DELETE operations when innodb_force_recovery is greater than 0.
You can SELECT from tables to dump them, or DROP or CREATE tables even if forced recovery is used. If you know that a given table is causing a crash on rollback, you can drop it. You can also use this to stop a runaway rollback caused by a failing mass import or ALTER TABLE. You can kill the mysqld process and set innodb_force_recovery to 3 to bring the database up without the rollback, then DROP the table that is causing the runaway rollback.
http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_force_recovery
http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html