It does not work to write a trigger that creates a new table with a name containing the row identifier of the original table.
Simply put, there is a table of owners with a primary key owner_id . When a new row is inserted into this table, a new table should be created, in the name of which this same owner_id will be present.
CREATE TRIGGER `owners_after_insert` AFTER INSERT ON `owners` FOR EACH ROW BEGIN CREATE TABLE IF NOT EXISTS CONCAT('`owner_', NEW.owner_id, '_members`') ( `user_id` BIGINT UNSIGNED NOT NULL , PRIMARY KEY(`user_id`) ) END In my version the muscle swears on CONCAT . How to get around this and implement the question in question?