Home > Database > Mysql Tutorial > body text

mysql 更新 语句中 的 safe_mode_MySQL

WBOY
Release: 2016-06-01 13:17:30
Original
1374 people have browsed it

 

在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;
即可
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!