Christopher Shaw
Mysql Workbench Disable Safemode
Posted on Monday 01st April 2019 in Snippet

By default MySQL Workbench has Safe Mode enabled, which prevents sql's which dont target a primary key.

"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"

Example of this would be

UPDATE tbl_users SET user_name = ''

In some situaltions you may need to do blanket SQL's such as above, I first ran into this when sanitizing a database for use in a dev enviroment.

In MySQL Workbench

  • Edit
  • Preferences
  • SQL Editor
  • Uncheck "Safe Updates"