#トリガーを削除するには、DROP コマンドを使用します。構文は次のとおりです。 −
DROP TRIGGER IF EXISTS yourTriggerName;
mysql> show triggers;
+-------------+--------+---------------+------------------------------------------------------------------------+--------+------------------------+--------------------------------------------+---------+----------------------+----------------------+--------------------+ | Trigger | Event | Table | Statement | Timing |Created | sql_mode | Definer | character_set_client | collation_connection | Database Collation | +-------------+--------+---------------+------------------------------------------------------------------------+--------+------------------------+--------------------------------------------+---------+----------------------+----------------------+--------------------+ | CheckSalary | INSERT | employeetable | if new.EmployeeSalary < 1000 then setnew.EmployeeSalary = 10000;end if | BEFORE | 2018-12-31 17:33:29.54 |STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | root@% | utf8 |utf8_general_ci | utf8mb4_0900_ai_ci | +-------------+--------+---------------+------------------------------------------------------------------------+--------+------------------------+--------------------------------------------+---------+----------------------+----------------------+--------------------+ 1 row in set (0.17 sec)
mysql> drop trigger if exists CheckSalary; Query OK, 0 rows affected (0.30 sec)
mysql> show triggers; Empty set (0.00 sec)
以上がMySQLにトリガーが存在する場合は削除しますか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。