MySQL Error 1175
If you are reading this it is probably because you are experiencing the following error:
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.
Why MySQL Workbench Error Code 1175 occur?
- Error Code 1175 means that you have SQL_SAFE_UPDATES set and are trying to do either of these things:
- UPDATE without specifying a key column
- This error is common with MySQL Workbench which enables this setting by default.
- This is a client side setting and is not configured on the server. It is similar to the MySQL client option “–safe-updates”.
- This option helps to prevent making mistakes while modifying a database.
How to Fix MySQL Error 1175
To fix MySQL error 1175 you can just disable safe update mode. You can enable it before running your update and then re-enable it after your update like this:
SET SQL_SAFE_UPDATES=0; UPDATE table SET column='value'; SET SQL_SAFE_UPDATES=1;
You can also disable this using the GUI.
- Goto: Edit ==> Preferences ==> SQL Editor
- Uncheck the box labeled “Safe Updates (rejects UPDATEs and DELETEs with no restrictions)”
Be careful with this setting turned off. Make absolutely sure that you know how to correctly use UPDATE and DELETE. It is easy to update or remove the wrong records. It is also easy to update or delete everything.