I need to give an user TRIGGER permission for an whole schema in mysql to import mysql workbench backup.
I tried with:
grant trigger ON `schemaname`.* TO `user`@`localhost`
But while importing there comes the error that the user haven’t the permissions.
ERROR 1142 (42000) at line 53: TRIGGER command denied to user 'user'@'localhost' for table 'table'
I tried to give the user TRIGGER permission to the table – that works, but of course only for that table, for the others still came the error.
Is there any way to give an user trigger permission to an schema without giving him the permission for every table separately?
From MySQL Docs
So you need to give SUPER privileges to the User. While importing, there will be command like “Create Trigger…” which is throwing an error.
Check your MySQL version and definer value as well for trigger in the importing file.
Edit:
For version 5.1, follow MySQL docs, that says:
So, you need to check Definer value for importing trigger. It might have something like :
DEFINER = root. Try removing the definer then try importing. Hope it works…