1

I have an update query that tries to update a set of entities in my database but it gives me this error

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

This were the two queries i tried

UPDATE persona
                                    ,tagged
                                    ,facedetails
                                    ,facelog
                                    ,`name`
                                    ,comments
                                    ,likes
                                    ,dislikes
                                        SET persona.`name` = "tobi",
                                            persona.face_id = "nfd",
                                            tagged.face_id = "nfd",
                                            facedetails.face_id = "nfd",
                                            facelog.face_id = "nfd",
                                            `name`.face_id = "nfd",
                                            comments.face_id = "nfd",
                                            likes.face_id = "nfd",
                                            dislikes.face_id = "nfd"
                                        WHERE persona.face_id = "JD55ab"

This works in phpmyadmin but doesn;t work in mysql work bench 6.3 CE

the second query is the same, works in phpmyadmin but not the other

    UPDATE persona 
                                        INNER JOIN tagged USING  (face_id)
                                        INNER JOIN facedetails USING  (face_id)
                                        INNER JOIN facelog USING  (face_id)
                                        INNER JOIN name USING  (face_id)
                                        INNER JOIN comments USING  (face_id)
                                        INNER JOIN likes USING  (face_id)
                                        INNER JOIN dislikes USING  (face_id)
                                        SET persona.name = "tobi",
                                            persona.face_id = "nfd",
                                            tagged.face_id = "nfd",
                                            facedetails.face_id = "nfd",
                                            facelog.face_id = "nfd",
                                            name.face_id = "nfd",
                                            comments.face_id = "nfd",
                                            likes.face_id = "nfd"
                                            dislikes.face_id = "nfd"
                                        WHERE persona.face_id = "JD55a"

is the query correct for the mysql workbench? because my where clause is present.

  • From the error text `toggle the option in Preferences -> SQL Editor and reconnect.` Change this option in your mysql work bench, Or disable safe update by command `SET SQL_SAFE_UPDATES = 0;` And I think `face_id` is not and PK of your table – Baximilian Jun 03 '15 at 13:38
  • @Baximilian I get the disable safe update fix but what if I don't want to disable it, how about your second opinion on the "face_id is not and PK of your table"; please what do you mean by this? –  Jun 03 '15 at 13:46
  • Look at [THIS](http://stackoverflow.com/q/11448068/2115584) question and all answers, I hope you'll find some additional information there. – Baximilian Jun 03 '15 at 13:59
  • Thanks! @Baximilian. Got it! –  Jun 03 '15 at 15:06

0 Answers0