更新查询在mysql工作台中不起作用 [英] Update query not working in mysql workbench

查看:78
本文介绍了更新查询在mysql工作台中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MySql查询,如下所示:

I have a MySql query, which is given below:

UPDATE signup SET lastname='Lastname', password='123'
WHERE firstname='Firstname';

我正在使用MySql Workbench执行查询.

I am using MySql Workbench to execute the query.

但是它没有更新该行并显示此错误:

But it's not updating the row and shows this error:

您使用的是安全更新模式,并且您尝试在不使用表的情况下更新表 使用KEY列的WHERE要禁用安全模式,请切换选项 在首选项"->"SQL编辑器"中,然后重新连接.

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 and reconnect.

推荐答案

在mysql工作台中,默认情况下启用安全模式,因此,如果您的WHERE子句没有密钥,将阻止运行查询.尝试使用以下步骤将其禁用-

In mysql workbench the safe mode is enabled by default, so if your WHERE clause doesn't have a key it will prevent running the query. Try disabling that using these steps -

Edit> Preferences> Sql Editor> uncheck the "Safe Updates"

注意-尝试重新连接服务器(Query> Reconnect to Server),然后再次运行查询.

Note - try reconnecting the server (Query > Reconnect to Server) and than run your query again.

这篇关于更新查询在mysql工作台中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆