I have a database including some tables, when I want to delete data from tables which includes an "Auto Increment" field, using this query:
delete from test.table1 ;
I got this error:
Error Code: 1030Got error -1 from storage engine
Why this happens? What should I do?
I also met this error while deleting 2 rows from an Innodb table, only 2 particular rows can't be deleted. I Google the error, but can't find better solutions.
So i tried this:
Create a backup for my db (exporting db).
Re-Installing MySQL Server
Restoring my db (importing db).
Then there is no -1 engine error on deletion/update.
Success...
I think the error may occur due to invalid configuration of MySQL server with respect to storage engines.
Thank You....
I see no answer has been selected as the right answer.
I found that in our database config we had the innodb_force_recovery configured. Once we disabled / commented it out, the queries ran as expected.
For me the problem was solved by restarting my database (in my case Mariadb).
Go to /etc/my.cnf or /etc/mysql/my.cnf
Comment line innodb_force_recovery=1
Save the file and restart mysql
Try to change
innodb_force_recovery
value (in your/etc/my.cnf
).Error -1 says NOTHING. Without your tables creation code (
SHOW CREATE TABLE table_name
) can not say where exactly problem is.Here's how I solved it, I just had the same error: