I am a Solivagant
Lofter    Posts     新文章     文章管理     新日记     日记管理

[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:

  1. Go to Edit --> Preferences
  2. Click "SQL Editor" tab and uncheck "Safe Updates" check box
  3. Query --> Reconnect to Server // logout and then login
  4. Now execute your SQL query

p.s., No need to restart the MySQL daemon!

 

posted @ 2018-06-06 20:03  宛如ZZ  阅读(261)  评论(0编辑  收藏  举报