MySQL you are using safe update mode error

If you're coming across an error "You are using safe update mode" when trying to run a MySQL query without a WHERE statement, this is due to a MySQL safeguard against you accidently overriding every data row in your database - so it's actually a wise setting option to have on for a live environment. If you do actually want to update every row in one go however and this setting is getting in the way, you can use the following command:

SET SQL_SAFE_UPDATES = 0;

This very simply switches off the safety check for your current session.

MySQL WorkBench

To permanently switch this feature off in MySQL WorkBench, follow these instructions:

  • Go to 'Edit' > 'Preferences' from the top menu
  • Click 'SQL Editor' and uncheck the 'Safe Updates' option
  • Re-connect to the server and you're good to go
Sign Up

NEXT: MySQL command to dump a database

Snippet with the MySQL command to dump and restore a database.

comments powered by Disqus
Sign Up

Popular Tags

350x250

Need a web developer?

If you'd like to work with code synthesis on your next project get in touch via the contact page.