[MySQL] SQL Tab : UPDATE 失败
platform: mysql workbench 8.0
error log:
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 ....
原因:
session 设置了 safe-updates option.
这意味着不使用键(如主键)操作会导致不能更新或者删除记录.
解决方法1:
针对该数据库.
SET SQL_SAFE_UPDATES = 0;
当然也可以在where语句中使用主键等键.
解决方法2:
- Go to
Edit
-->Preferences
- Click
"SQL Editor"
tab anduncheck
"Safe Updates"check box
Query
-->Reconnect to Server
// logout and then login- Now execute your SQL query
p.s., No need to restart the MySQL daemon!
宛如智障,暗藏锋芒