Phpmyadmin Drop All Triggers Database

[Solved] Phpmyadmin Drop All Triggers Database | Shell - Code Explorer | yomemimo.com
Question : phpmyadmin drop all triggers database

Answered by : hirohito

-- set `group_concat_max_len`
SET @@session.group_concat_max_len = @@global.max_allowed_packet;
-- select all the triggers and build the `DROP TRIGGER` SQL
-- replace <your_schema> with your schema name (e.g. your database name)
SELECT GROUP_CONCAT(sql_string SEPARATOR '\n')
FROM ( SELECT CONCAT('DROP TRIGGER IF EXISTS `', TRIGGER_NAME, '`;') AS sql_string,'1' FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA = '<your_schema>' ) AS sql_strings
GROUP BY '1';
-- example result:
-- DROP TRIGGER IF EXISTS `trigger1`;
-- DROP TRIGGER IF EXISTS `trigger2`;
-- (...)

Source : https://stackoverflow.com/a/32146510/16118520 | Last Update : Wed, 04 Jan 23

Answers related to phpmyadmin drop all triggers database

Code Explorer Popular Question For Shell