码迷,mamicode.com
首页 > 数据库 > 详细

MySQL Workbench批量更新或删除

时间:2015-08-31 15:32:38      阅读:974      评论:0      收藏:0      [点我收藏+]

标签:mysql workbench

在使用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. 0.000 sec

因为是MySQL Workbench的默认的安全设置是不能批量更新表的。

解决方法:

一、在SQL语句之前添加

    SET SQL_SAFE_UPDATES = 0;

二、修改MySQL Workbench设置:

  • 打开Workbench的菜单[Edit]->[Preferences...]

  • 切换到[SQL Queries]页面(不同版本可能在SQL Editor)

  • “Safe Updates”.Forbid UPDATEs and DELETEs with no key in WHERE clause or no LIMIT clause.Requires a reconnection之前的对勾去掉.

  • 点击【OK】,重启Workbench.


MySQL Workbench批量更新或删除

标签:mysql workbench

原文地址:http://java2013.blog.51cto.com/2841631/1690053

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!