MySQL 错误代码:在 MySQL Workbench 中更新期间出现 1175

2022-01-17 00:00:00 sql-update mysql mysql-workbench

我正在尝试更新列 visited 以赋予其值 1.我使用 MySQL 工作台,并且正在工作台内部的 SQL 编辑器中编写语句.我正在编写以下命令:

I'm trying to update the column visited to give it the value 1. I use MySQL workbench, and I'm writing the statement in the SQL editor from inside the workbench. I'm writing the following command:

UPDATE tablename SET columnname=1;

它给了我以下错误:

您正在使用安全更新模式,并且您尝试在没有更新的情况下更新表使用 KEY 列的 WHERE 要禁用安全模式,请切换选项....

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

我按照说明进行操作,然后取消选中 Edit 菜单中的 safe update 选项,然后取消选中 Preferences 然后 SQL Editor.同样的错误仍然出现 &我无法更新此值.请告诉我有什么问题?

I followed the instructions, and I unchecked the safe update option from the Edit menu then Preferences then SQL Editor. The same error still appear & I'm not able to update this value. Please, tell me what is wrong?

推荐答案

我找到了答案.问题是我必须在表名之前加上模式名.即,命令应该是:

I found the answer. The problem was that I have to precede the table name with the schema name. i.e, the command should be:

UPDATE schemaname.tablename SET columnname=1;

谢谢大家.

相关文章