MySQL 错误代码:1030 来自存储引擎的错误 -1;我试图从我的数据库中删除数据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4067461/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL Error Code: 1030Got error -1 from storage engine; I've tried to delete data from my database
提问by rain
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?
为什么会发生这种情况?我该怎么办?
回答by ksogor
Try to change innodb_force_recovery
value (in your /etc/my.cnf
).
尝试更改innodb_force_recovery
值(在您的 中/etc/my.cnf
)。
Error -1says NOTHING. Without your tables creation code (SHOW CREATE TABLE table_name
) can not say where exactly problem is.
错误 -1 什么也没说。没有您的表创建代码 ( SHOW CREATE TABLE table_name
) 无法说出问题究竟出在哪里。
回答by ToBe_HH
You also get this error, if your file system is full.
如果您的文件系统已满,您也会收到此错误。
回答by Randall Stevens
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.
我刚拿到这个,这是因为我希望新表所在的 SSD 驱动器上的新文件夹是在 root 下创建的,而 mysql 在 mysql 用户下运行。所以 cd 到你的数据文件夹 chown mysql 。它解决了这个问题。
回答by HCS420
Go to /etc/my.cnf or /etc/mysql/my.cnf
转到 /etc/my.cnf 或 /etc/mysql/my.cnf
Comment line innodb_force_recovery=1
注释行 innodb_force_recovery=1
Save the file and restart mysql
保存文件并重启mysql
回答by Kiran P.
FIXED!!check your memory by df -h
. also check inodes df -i
. if its full, delete some files.
固定的!!检查你的记忆df -h
。还要检查 inode df -i
。如果已满,请删除一些文件。
回答by user2338416
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.
我在从 Innodb 表中删除 2 行时也遇到了这个错误,只有 2 行不能被删除。我谷歌了错误,但找不到更好的解决方案。
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.
为我的数据库创建一个备份(导出数据库)。
重新安装 MySQL 服务器
恢复我的数据库(导入数据库)。
然后在删除/更新时没有 -1 引擎错误。
Success...
成功...
I think the error may occur due to invalid configuration of MySQL server with respect to storage engines.
我认为错误可能是由于 MySQL 服务器在存储引擎方面的配置无效造成的。
Thank You....
谢谢你....
回答by Haim Evgi
try repairtable (ISAM engine)
尝试修复表(ISAM引擎)
if its innodb engine look at this link :
如果它的 innodb 引擎看这个链接:
http://www.mysqlperformanceblog.com/2008/07/04/recovering-innodb-table-corruption/
http://www.mysqlperformanceblog.com/2008/07/04/recovering-innodb-table-corruption/
回答by Enzo
I see no answer has been selected as the right answer.
我看到没有答案被选为正确答案。
I found that in our database config we had the innodb_force_recoveryconfigured. Once we disabled / commented it out, the queries ran as expected.
我发现在我们的数据库配置中我们配置了innodb_force_recovery。一旦我们禁用/注释掉它,查询就会按预期运行。
回答by Lav Patel
Find the value of innodb_force_recovery
at /etc/mysql/my.cnf
(for linux). if it is 0, remove it or comment it out.
找到innodb_force_recovery
at 的值/etc/mysql/my.cnf
(对于 linux)。如果它是0,将其删除或注释掉。
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.
InnoDB:innodb_force_recovery 开启:我们不允许用户修改 InnoDB:数据库。
回答by passenger
For me the problem was solved by restarting my database (in my case Mariadb).
对我来说,问题是通过重新启动我的数据库(在我的情况下是 Mariadb)来解决的。
systemctl restart mariadb