Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permenantly disable Safe Updates in MySQL Workbench?

Re: the error "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column"

The two options to fix this are disabling safe mode through the gui (Edit>Preferences>Sql Editor) or by manually entering SET SQL_SAFE_UPDATES = 0;

However, everything I'm reading seems to indicate you must do this every time you connect. Is there a way to disable Safe Update Mode permanently so I don't need to do this every time?

like image 369
Alex Russell Avatar asked Jan 03 '18 21:01

Alex Russell


People also ask

What is safe UPDATE mode in MySQL?

Safe Updates: When enabled (default), MySQL Workbench will not execute UPDATE or DELETE statements if a key is not defined in the WHERE clause. In other words, MySQL Workbench attempts to prevent big mistakes, such as deleting a large number of (or all) rows.

Is MySQL Workbench safe?

To give an answer on your question: No it's not safe.


1 Answers

Given that Workbench (at least in Windows-world) restores your open queries, if you keep SET SQL_SAFE_UPDATES = 0; in a query window, it will be quicker to re-run at start-up than re-entering it. Maybe there are other settings which aren't saved but could be added too. Like if there was one to say "no side panels please", or "show Schema, not Administration".

Not ideal, but every little helps.

like image 191
DJDave Avatar answered Sep 18 '22 08:09

DJDave