‘MySQL Workbench - Error Code: 1175’
Have you ever encountered the following error while using MySQL workbench?
Error Code: 1175 You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
This is a safety feature which has been implemented to prevent bad queries from destroying your table. But we know our query is right and that it has to run. So what do we do?
There are 2 ways to proceed from here:
- a temporary fix
- a permanent fix
For a temporary fix, here is what you need to do:
SET SQL_SAFE_UPDATES=0;
.. run your query ..
SET SQL_SAFE_UPDATES=1;
No application restart required.
For a more permanent fix, do this:
- Select Edit -> Preferences
- Navigate to SQL Editor Tab
- Uncheck this option: Forbid UPDATE and DELETE statements without a WHERE clause (safe updates)
Cheers!