无法删除触发器,因为它“不存在”

时间:2019-09-02 14:47:31

标签: mysql triggers

我有以下两个触发器

cascadeUserInsertionToRecommendations_tbl

afterinsertiontousers

为了完整起见,下面是“显示触发器”的结果。

+-------------------------------------------+--------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------------------+-----------------------------------------------------+---------+----------------------+----------------------+--------------------+
| Trigger                                   | Event  | Table     | Statement                                                                                                                                              | Timing | Created                | sql_mode                                            | Definer | character_set_client | collation_connection | Database Collation |
+-------------------------------------------+--------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------------------+-----------------------------------------------------+---------+----------------------+----------------------+--------------------+
| cascadeUserInsertionToRecommendations_tbl | INSERT | users_tbl | INSERT INTO recommendations_tbl(recommendation_userid, recommendation_category, recommendation_manufacturer) VALUES(NEW.user_id, 'diverse', 'diverse') | AFTER  | 2019-09-02 12:32:46.19 | NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION | @       | latin1               | latin1_swedish_ci    | latin1_swedish_ci  |
| afterinsertiontousers                     | INSERT | users_tbl | INSERT INTO recommendations_tbl(recommendation_userid, recommendation_category, recommendation_manufacturer) VALUES(NEW.user_id, DEFAULT, DEFAULT)     | AFTER  | 2019-09-02 15:48:39.52 | NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION | @       | latin1               | latin1_swedish_ci    | latin1_swedish_ci  |
+-------------------------------------------+--------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------------------+-----------------------------------------------------+---------+----------------------+----------------------+--------------------+

现在的问题是我不能放下它们:/ 在进行基础测试时,创建触发器的数据库如下:

CREATE TRIGGER afterinsertiontousers
    -> AFTER INSERT ON users_tbl
    -> FOR EACH ROW
    -> INSERT INTO recommendations_tbl(recommendation_userid, recommendation_category, recommendation_manufacturer) VALUES(NEW.user_id, DEFAULT, DEFAULT);
Query OK, 0 rows affected (0.016 sec)

会发生什么:

MariaDB [foundationtests]> DROP TRIGGER users_tbl.cascadeUserInsertionToRecommendations_tbl;
ERROR 1360 (HY000): Trigger does not exist

我已经交换到information_schema数据库,并在那里删除了上面的触发器。但是,它仍然显示在此处并且仍在执行其工作,这不应该...

我读到有关必须在SO上的其他多个线程上使用“ db5”的信息,但是当使用“显示数据库”时,我无法访问该数据库,也不会显示在数据库列表中; 所以我对想念的东西一无所知

0 个答案:

没有答案