在应用 BUG或者 DBA误操作的情况下,会发生对全表进行更新:update delete 的情况。MySQL提供 sql_safe_updates 来限制次操作。 set sql_safe_updates = 1;
设置之后,会限制update delete 中不带 where 条件的SQL 执行,较严格。
【数据存储与数据库】 【mysql】 【索引】 【test】 【index】 【Create】 …
Ideas, releases, practical guides, and perspectives from the people building with MySQL.
操作mysql数据库,删除表中的某一行数据提示如下错误:ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
错误提示:正在使用安全更新模式,尝试更新表没有使用键列的where条件;
原因是:mysql有个叫SQL_SAFE_UPDATES的变量,为了数据库更新操作的安全性,此值默认为1,所以才会出现更新失败的情况。
【mysql】 【数据库】 【test】 【variables】 …
错误信息如下
1 2 3 4 5 6 7 8
# Time: 140122 16:34:23 # User@Host: xxxxxxx # Thread_id:
19904440 Schema: xxxx Last_errno: 1205 Killed:
0 # Query_time: 200.
【mysql】 【lock】 【索引】 【timestamp】 点击查看原文>