在MySQL Workbench中,如果执行类似以下的语句,
可能会遇上如下的出错信息
Error Code: 1175. 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 Queries and reconnect.
具体的原因,可以参见MySQL的文档[url]http://dev.mysql.com/doc/refman/5.6/en/mysql-command-options.html#option_mysql_safe-updates[/url]
可以通过以下方法来解决
当然了,如果想查询当时变量的值,也可以通过如下方法
或是
UPDATE tablename SET columnname=0;
可能会遇上如下的出错信息
Error Code: 1175. 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 Queries and reconnect.
具体的原因,可以参见MySQL的文档[url]http://dev.mysql.com/doc/refman/5.6/en/mysql-command-options.html#option_mysql_safe-updates[/url]
可以通过以下方法来解决
SET SQL_SAFE_UPDATES=0;
当然了,如果想查询当时变量的值,也可以通过如下方法
SHOW VARIABLES LIKE 'sql_safe_updates';
或是
select @@sql_safe_updates;