Dennis Zaitsev
Dennis Zaitsev

Reputation: 825

How to check if sql_safe_updates is on?

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?

Upvotes: 21

Views: 37020

Answers (3)

Sahil Thummar
Sahil Thummar

Reputation: 2500

The following query returns output ON/OFF

SHOW VARIABLES LIKE "sql_safe_updates";

enter image description here

The following query returns output 0/1

select @@sql_safe_updates;

enter image description here

output shows that the safe update mode is enabled or disabled now.

1 and ON for enabled.
0 and OFF for disabled

Upvotes: 2

Ryan
Ryan

Reputation: 1221

Or...

select @@sql_safe_updates;

Upvotes: 17

Matt Dodge
Matt Dodge

Reputation: 11142

SHOW VARIABLES LIKE 'sql_safe_updates'

Upvotes: 27

Related Questions