欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

mysql 更新 语句中 的 safe_mode_MySQL

程序员文章站 2022-05-29 08:49:11
...

在mysql5中,可以设置safe mode,比如在一个更新语句中
UPDATE table_name SET bDeleted=0;
执行时会错误,报:
You are using safe update mode and you tried to update a table without a WHERE clause that uses a KEY column.”
原因是在safe mode下,要强制安全点,update只能跟where了,
要取消这个限制,可以:
SET SQL_SAFE_UPDATES=0;
即可
相关标签: mysql