DEV Community

Seong Bae
Seong Bae

Posted on

MySQL Safe Update Mode

I swear... I can never remember the syntax to change MySQL's safe update mode. I always have to google it.

To turn off safe update mode:

SET SQL_SAFE_UPDATES = 0;
Enter fullscreen mode Exit fullscreen mode

Please remember to set it back to 1 after running your mass-update/mass-delete query.

SET SQL_SAFE_UPDATES = 1;
Enter fullscreen mode Exit fullscreen mode

Safe coding!

Top comments (0)