MySQL存储引擎错误码,Mysql'来自存储引擎的错误-1'错误

I have a myism table 'test' which holds some out-dated data, now I want to recreate the table, all columns the same except that I changed the storage from myism to innodb. The dumped sql I used to recreate the table is like:

drop table test;

create table test ( ... )

engine=innodb

insert into test(...) values(...)

that's where I got the error "Got Error -1 from storage engine", I have googled around, most of the results focus on corrupted innodb tables. While for my case I don't think it's broken, it's just something I missed at the drop and create statements.

Another thing is that is after a executed the above sql, all that's left for table test is a file named file.frm, I guess innodb table needs some other stuff to run on but not sure what.

How can I fix this problem? And I probably need to do more tasks of this kind, what's the correct procedure to drop myism table and recreate them as innodb ones?

Thanks.

解决方案

OK. I found the solution.

The issue was caused by innodb_force_recovery parameter in my.cnf, that was set to 4.

To solve the problem, set to 0 or completely remove this parameter from my.cnf

If you check error log, during query, mysql will write in human readable language that: It won't let you change anything in table until innodb recovery mode is enabled, exactly next message:

InnoDB: A new raw disk partition was initialized or

InnoDB: innodb_force_recovery is on: we do not allow

InnoDB: database modifications by the user. Shut down

InnoDB: mysqld and edit my.cnf so that newraw is replaced

InnoDB: with raw, and innodb_force_... is removed.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值