Error Code: 2013. Lost connection to MySQL server during query

后端 未结 29 2119
深忆病人
深忆病人 2020-11-22 16:22

I got the Error Code: 2013. Lost connection to MySQL server during query error when I tried to add an index to a table using MySQL Workbench. I noticed als

29条回答
  •  旧时难觅i
    2020-11-22 16:41

    Three things to be followed and make sure:

    1. Whether multiple queries show lost connection?
    2. how you use set query in MySQL?
    3. how delete + update query simultaneously?

    Answers:

    1. Always try to remove definer as MySQL creates its own definer and if multiple tables involved for updation try to make a single query as sometimes multiple query shows lost connection
    2. Always SET value at the top but after DELETE if its condition doesn't involve SET value.
    3. Use DELETE FIRST THEN UPDATE IF BOTH OF THEM OPERATIONS ARE PERFORMED ON DIFFERENT TABLES

提交回复
热议问题