MySQL error code: 1175 during UPDATE in MySQL Workbench

前端 未结 20 1337
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 09:58

I\'m trying to update the column visited to give it the value 1. I use MySQL workbench, and I\'m writing the statement in the SQL editor from inside the workben

20条回答
  •  梦谈多话
    2020-11-22 10:58

    Error Code: 1175. 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 in Preferences -> SQL Editor and reconnect.

    Turn OFF "Safe Update Mode" temporary

    SET SQL_SAFE_UPDATES = 0;
    UPDATE options SET title= 'kiemvieclam24h' WHERE url = 'http://kiemvieclam24h.net';
    SET SQL_SAFE_UPDATES = 1;
    

    Turn OFF "Safe Update Mode" forever

    Mysql workbench 8.0:

    MySQL Workbench => [ Edit ] => [ Preferences ] -> [ SQL Editor ] -> Uncheck "Safe Updates"
    

    Old version can:

    MySQL Workbench => [Edit] => [Preferences] => [SQL Queries]
    

提交回复
热议问题