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

房东的猫 提交于 2019-11-28 09:05:54
John Woo

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

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!