問題描述
我正在嘗試更新列 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;
謝謝大家.
這篇關于MySQL 錯誤代碼:1175 在 MySQL Workbench 中的 UPDATE 期間的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!