You are using safe update mode and you tried to update a table without a WHERE that uses a KEY colum
具体报错
delete from xxx where xxx= 'xxx' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.016 sec
- 由于
sql_safe_updates
为ON
,不加主键更改操作会报错。 show variables like 'SQL_SAFE_UPDATES';
查看状态
解决方案
第一种
- 执行命令
SET SQL_SAFE_UPDATES = 0;
修改下数据库模式
第二种
- 在SQL语句后面加上
and id>0
。如下图所示。