I know that sql_safe_updates can be set to either 1 or 0 by for example running
SET sql_safe_updates=1;
How can I check if it's already on in command line?
Checking the current value of the safe update mode:Run the following command from the mysql prompt to check the current value of the sql_safe_updates variable. SHOW VARIABLES LIKE "sql_safe_updates"; The following output shows that the safe update mode is disabled.
The SET statement affects statement processing as follows: Enabling sql_safe_updates causes UPDATE and DELETE statements to produce an error if they do not specify a key constraint in the WHERE clause, or provide a LIMIT clause, or both.
To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.
This means that you can't update or delete records without specifying a key (ex. primary key ) in the where clause. Try: SET SQL_SAFE_UPDATES = 0; Or you can modify your query to follow the rule (use primary key in where clause ).
SHOW VARIABLES LIKE 'sql_safe_updates'
Or...
select @@sql_safe_updates;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With