v @avi.im · Oct 22

Pro database tip: enable `SQL_SAFE_UPDATES` in MySQL to avoid accidental UPDATE/DELETE queries without a WHERE clause. It forces you to use a key or a LIMIT, instead of wiping whole database by mistake at 2:19am.

17 likes 2 replies

?

Replies

Ronja ΘΔ · Oct 23

Do you know if there is a similar thing for MariaDB?

v · Oct 22

BTW, SQL_SAFE_UPDATES also auto-enables two other protections: - Limits SELECT to 1,000 rows (no more accidental SELECT * on giant tables) - Caps joins at 1M row combinations You can override these with --select-limit and --max-join-size if needed.