MySQL error code: 1175 during UPDATE in MySQL Workbench
SET SQL_SAFE_UPDATES=0;
UPDATE tablename SET columnname=1;
SET SQL_SAFE_UPDATES=1;
It looks like your MySql session has the safe-updates option set. 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
).
SET SQL_SAFE_UPDATES = 0;
# your code SQL here
SET SQL_SAFE_UPDATES = 1;
Follow the following steps before executing the UPDATE command: In MySQL Workbench
- Go to
Edit
-->Preferences
- Click
"SQL Editor"
tab anduncheck
"Safe Updates"check box
Query
-->Reconnect to Server
// logout and then login- Now execute your SQL query
p.s., No need to restart the MySQL daemon!