Avoid Update or delete without using where clause in MySQL
SQL_SAFE_UPDATES uses:
error appears while trying to update or delete records without including the WHERE clause that uses the KEY column. By default disable.
For Enable:
mysql> set sql_safe_updates=1;
Query OK, 0 rows affected (0.00 sec)
mysql> update test set id = 3;
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.
For Disable:
mysql> set sql_safe_updates=0;
Query OK, 0 rows affected (0.00 sec)
mysql> update test set id = 3;
mysql> update test set id = 3;
Query OK, 0 rows affected (0.01 sec)
Rows matched: 2 Changed: 0 Warnings: 0