1175ERRORTier 2 — Caution✅ HIGH confidenceYou are using safe update mode and tried to update a table without a WHERE using a KEY column
What this means
Error 1175 is returned when sql_safe_updates mode is enabled and a UPDATE or DELETE statement is executed without a WHERE clause that references an indexed column, or without a LIMIT clause. This is a safety net to prevent accidental full-table updates or deletes, common in MySQL Workbench by default.
Why it happens
- 1Running UPDATE table SET col = val without a WHERE clause
- 2Running DELETE FROM table without a WHERE clause
- 3A WHERE clause that does not reference any indexed (KEY) column
How to reproduce
A DELETE without a WHERE clause is run with sql_safe_updates enabled.
SET sql_safe_updates = 1;
DELETE FROM users; -- no WHERE clauseFix 1: Add a proper WHERE clause
When you intend to update or delete specific rows.
DELETE FROM users WHERE id = 42;Why this works
A WHERE clause that references an indexed column satisfies safe update mode. The query affects only the matching rows.
Fix 2: Disable safe update mode for the session if a full-table operation is intended
When a bulk operation on all rows is deliberate.
SET sql_safe_updates = 0;
TRUNCATE TABLE sessions; -- or DELETE FROM sessions;
SET sql_safe_updates = 1; -- re-enable afterWhy this works
Temporarily disabling safe update mode allows the full-table operation. Re-enabling it afterwards restores the safety net. Use TRUNCATE TABLE for deleting all rows — it is faster than DELETE FROM for large tables.
What not to do
Permanently disable sql_safe_updates in the server configuration
Why it's wrong: Safe update mode is an important last-resort protection against accidental mass deletions and updates, particularly in interactive sessions.
Version notes
All versionssql_safe_updates is a session variable. MySQL Workbench enables it by default for interactive connections.Sources
📚 Official docs: https://mariadb.com/kb/en/server-system-variables/#sql_safe_updates
🔧 Source ref: MariaDB Server error code 1175 / ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
📖 Further reading: MariaDB sql_safe_updates
Confidence assessment
✅ HIGH confidence
Stable. Safe update mode semantics are consistent across versions.
See also
🔗 Related errors
📄 Reference pages