Mysql 'Got error -1 from storage engine' error

A common cause for the -1 error is a full disk. I have different small VMs for testing purposes, and innodb just keeps filling them up (and I keep forgetting about it).

$df -ah

If it shows you the disk at 100%, that's the origin of the -1 right there ;)


I had this with an SQL import on Azure and needed to change

ENGINE=MyISAM with ENGINE=InnoDB


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.

Please refer to: http://bugs.mysql.com/bug.php?id=30225

Tags:

Mysql

Innodb