2020-06-01
阅读量:
1153
mysql报错:Error Code: 1175
当我使用MySQL 执行更新或删除操作时,mysql 报了这样一个错误:
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.
原因: MySql运行在safe-updates模式下,该模式会导致非主键条件下无法执行update或者delete命令
查看一下safe_updates
show variables like '%safe_update%';
发现safe_update模式是开启的
关闭模式
SET SQL_SAFE_UPDATES = 0;
现在再进行update ,delete 操作就不会报错了
但是如果有些情况下为了安全起见,也可以设置开启safe_updates 模式:
SET SQL_SAFE_UPDATES = 1;
————————————————
版权声明:本文为CSDN博主「Mr.路痴」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43054397/java/article/details/91843134






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论