Friday 19 July 2019

MySQL error code: 1175 during UPDATE in MySQL Workbench




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;


It gives me the following error:




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

....




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?


Answer



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;



Thanks all.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...