开发者社区 问答 正文

mysql修改数据必须加上条件,且条件为主键吗?

update tb_phoneMe_nbr p set p.current_status = p.before_status where p.current_status = 2
这个是我的sql,但是执行时报错,主键为pm_id
这个是报的错误。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 Editor -> Query Editor and reconnect.

展开
收起
落地花开啦 2016-02-13 15:24:08 2625 分享 版权
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    mysql workbeanch 里面可以修改
    具体操作:edit-preference-sql editor
    把query Editor 中的safe update 去掉

    2019-07-17 18:42:04
    赞同 展开评论