【MySQL Workbench】safe updateエラーの対処方法

事象
UPDATE文を実行したら、下記のエラーが出力された。
UPDATE m_company SET id = id;
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. 0.000 sec
原因
UPDATEで大量のデータが対象になるのを防ぐ機能によるエラーです。
主キーやユニーク制約がかかっている条件であれば突破できますが、それ以外の条件や、条件がない場合はエラーになります。
対処方法
下記の方法でSafe Updateを無効にできます。
- Edit
- Preferences
- SQL Editor
- Safe Updatesのチェックを外す
- OK
- MySQL Workbenchを再起動

以上になります。
お読み頂き、ありがとうございました。