innodb_forced_recovery> 0时不允许操作[SqlYog]

时间:2021-09-29 03:39:32

I have created a table using SQLyog. When i insert values into it, it pops up following error message:

我用SQLyog创建了一个表。当我在其中插入值时,会弹出以下错误消息:

Operation not allowed when innodb_forced_recovery > 0.

My table consist only four columns including one primary key. Following is my create and insert queries:

我的表只包含四列,包括一个主键。以下是我的创建和插入查询:

CREATE TABLE `news` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `descr` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1

insert into `test`.`news` (`title`, `slug`, `descr`)
 values ('titleOne', 'slugOne', 'descOne')

2 个解决方案

#1


13  

This error is comes when MySQL is in Read only mode.

MySQL处于只读模式时会出现此错误。

Edit file /etc/my.cnf.

编辑文件/etc/my.cnf。

And comment out following line

并注释掉以下内容

# innodb_force_recovery = 1

Apparently this setting causes innodb to become read-only. If you don't have access to /etc/my.cnf on shared hosting, ask your host to fix it for you. When it's commented out or non-existent in /etc/my.cnf, the it reverts to a default setting of 0.

显然,此设置会使innodb变为只读。如果您无法访问共享主机上的/etc/my.cnf,请让您的主机为您进行修复。当它在/etc/my.cnf中被注释掉或不存在时,它将恢复为默认设置0。

#2


0  

This happens to me also but what i did was to change the SQL Engine during creatng the table from InnoDB to MyISAM like in ENGINE=innoDB to ENGINE=MyISAM

这也发生在我身上,但我所做的是在从InnoDB到MyISAM的创建过程中更改SQL引擎,如ENGINE = innoDB到ENGINE = MyISAM

So if you have your database and want to upload it, open it with any editor and change the engine at the end of each table from innoDB to MyISAM.

因此,如果您有数据库并想要上传它,请使用任何编辑器打开它,并将每个表末尾的引擎从innoDB更改为MyISAM。

this resolved the problem.

这解决了这个问题。

#1


13  

This error is comes when MySQL is in Read only mode.

MySQL处于只读模式时会出现此错误。

Edit file /etc/my.cnf.

编辑文件/etc/my.cnf。

And comment out following line

并注释掉以下内容

# innodb_force_recovery = 1

Apparently this setting causes innodb to become read-only. If you don't have access to /etc/my.cnf on shared hosting, ask your host to fix it for you. When it's commented out or non-existent in /etc/my.cnf, the it reverts to a default setting of 0.

显然,此设置会使innodb变为只读。如果您无法访问共享主机上的/etc/my.cnf,请让您的主机为您进行修复。当它在/etc/my.cnf中被注释掉或不存在时,它将恢复为默认设置0。

#2


0  

This happens to me also but what i did was to change the SQL Engine during creatng the table from InnoDB to MyISAM like in ENGINE=innoDB to ENGINE=MyISAM

这也发生在我身上,但我所做的是在从InnoDB到MyISAM的创建过程中更改SQL引擎,如ENGINE = innoDB到ENGINE = MyISAM

So if you have your database and want to upload it, open it with any editor and change the engine at the end of each table from innoDB to MyISAM.

因此,如果您有数据库并想要上传它,请使用任何编辑器打开它,并将每个表末尾的引擎从innoDB更改为MyISAM。

this resolved the problem.

这解决了这个问题。