Error (Error Code: 1175) during executing update command on table using MySQL Workbench 5.2

前端 未结 2 585
别那么骄傲
别那么骄傲 2020-12-09 17:14

I\'m using MySQL Server5.5 in which MySQL Workbench 5.2 CE is included. I\'m using MySQL Workbench 5.2 . I have a table named user in DB. I executed the fol

相关标签:
2条回答
  • 2020-12-09 17:58

    It is more correct to deactivate and reactivate

    SET SQL_SAFE_UPDATES=0; --disable
    UPDATE user SET email = 'abc@yahoo.com' WHERE email='ripon.wasim@yahoo.com';
    SET SQL_SAFE_UPDATES=1; --enable
    
    0 讨论(0)
  • 2020-12-09 18:16

    Every time you encountered that kind of error when trying to update rows in mysql, It’s because you tried to update a table without a WHERE that uses a KEY column.

    You can fix it using,

    SET SQL_SAFE_UPDATES=0;
    UPDATE user SET email = 'abc@yahoo.com' WHERE email='ripon.wasim@yahoo.com';
    

    or in the WorkBench

    • Edit -> Preferences -> SQL Queries
    • Uncheck Forbid UPDATE and DELETE statements without a WHERE clause (safe updates)
    • Query --> Reconnect to Server

    0 讨论(0)
提交回复
热议问题