Ravi Sir's Cyber Security Cards › Interview Cards
What is SQL_SAFE_UPDATES and why does MySQL error 1175 appear?
What is SQL_SAFE_UPDATES and why does MySQL error 1175 appear? SQL_SAFE_UPDATES blocks an UPDATE or DELETE that has no key-based WHERE. Error 1175 is that block. It stops a beginner from running DELETE FROM orders with no WHERE and wiping the whole table. “I fix the query with a proper key-based WHE

Read card text
What this card says
Short answer
SQL_SAFE_UPDATES blocks an UPDATE or DELETE that has no key-based WHERE. Error 1175 is that block.
Example
It stops a beginner from running DELETE FROM orders with no WHERE and wiping the whole table.
Say it in the interview
“I fix the query with a proper key-based WHERE, I don’t just turn the guard off.”
Why it matters
Turning it off and running the bad query can delete every row by accident.
Learn more in the lesson: 46.4 Web Servers and MySQL Interview Questions