gpt4 book ai didi

mysql - 如何删除坏触发器

转载 作者:行者123 更新时间:2023-11-29 06:05:54 24 4
gpt4 key购买 nike

在 Mysql 版本 5.0.77 上,我运行了这个

CREATE TRIGGER ins_trap_to_memory AFTER INSERT on Table1
FOR EACH ROW
INSERT INTO Table1_Copy SELECT NEW.*;

它运行了,但现在每当我尝试执行某些操作时数据库就会断开连接:

无法查看触发器-

mysql> SHOW TRIGGERS LIKE '%'\G
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 7
Current database: mydb

ERROR 2013 (HY000): Lost connection to MySQL server during query

无法删除问题触发器-

mysql> DROP TRIGGER ins_trap_to_memory;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

无法查询information_schema.TRIGGERS-

mysql> select * from information_schema.TRIGGERS;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 12
Current database: information_schema

ERROR 2013 (HY000): Lost connection to MySQL server during query

最佳答案

其他类型的查询是否有效?

在我看来,这两者不太可能相关,除非 Table1 可能连续进行大量插入,并且这是服务器过载的结果。这可能只是间歇性连接问题。

无论哪种方式,您都应该能够通过以下方式删除它:

DROP TRIGGER ins_trap_to_memory ON Table1

关于mysql - 如何删除坏触发器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11525919/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com