If WHERE clause does not have primary key in UPDATE query then this error comes. If you want to run the update query without having primary key in WHERE clause of UPDATE query then below command needs to be run to disable the safe mode.
SET SQL_SAFE_UPDATES = 0;
It is good to run SET SQL_SAFE_UPDATES = 1; after running your UPDATE query and again enable the safe mode.
UPDATE table_name SET col_name=1;
Post a Comment