rain
rain

Reputation: 403

MySQL Error Code: 1030Got error -1 from storage engine; I've tried to delete data from my database

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?

Upvotes: 7

Views: 36365

Answers (12)

passenger
passenger

Reputation: 1

For me the problem was solved by restarting my database (in my case Mariadb).

systemctl restart mariadb

Upvotes: 0

A. Rivera
A. Rivera

Reputation: 1

Here's how I solved it, I just had the same error:

  1. Open Control Panel
  2. Select Unistall Programs
  3. Right click and select"Uninstall" on Microsoft Visual Basic Tools
  4. Restart your PC

Upvotes: -2

Lav Patel
Lav Patel

Reputation: 1047

Find the value of innodb_force_recovery at /etc/mysql/my.cnf(for linux). if it is 0, remove it or comment it out.

Example

innodb_force_recovery = 0

change it to:

#innodb_force_recovery = 0

Reference:

InnoDB: innodb_force_recovery is on: we do not allow InnoDB: database modifications by the user.

Upvotes: 1

Enzo
Enzo

Reputation: 31

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.

Upvotes: 0

Bin.Zhou
Bin.Zhou

Reputation: 1

Just modify to

#innodb_force_recovery = 1

It works to me.

Upvotes: -1

Max
Max

Reputation: 1548

FIXED!! check your memory by df -h. also check inodes df -i. if its full, delete some files.

Upvotes: 0

HCS420
HCS420

Reputation: 29

Go to /etc/my.cnf or /etc/mysql/my.cnf

Comment line innodb_force_recovery=1

Save the file and restart mysql

Upvotes: 2

Randall Stevens
Randall Stevens

Reputation: 596

I just got this one and it was due to the fact that the new folder on the SSD drive where I wanted the new table to go was created under root and mysql runs under the mysql user. So cd to your data folder chown mysql . and it solves the problem.

Upvotes: 1

ksogor
ksogor

Reputation: 873

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.

Upvotes: 8

ToBe_HH
ToBe_HH

Reputation: 716

You also get this error, if your file system is full.

Upvotes: 3

user2338416
user2338416

Reputation: 1

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:

  1. Create a backup for my db (exporting db).

  2. Re-Installing MySQL Server

  3. Restoring my db (importing db).

  4. 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....

Upvotes: 0

Haim Evgi
Haim Evgi

Reputation: 125466

try repair table (ISAM engine)

if its innodb engine look at this link :

http://www.mysqlperformanceblog.com/2008/07/04/recovering-innodb-table-corruption/

Upvotes: 0

Related Questions