When I insert data into the table, I get the error:

Error Code: 1142
TRIGGER command denied to user 'root' @ '%' for table 'import_files_log'

In this case, both my current user and the DEFINER trigger associated with the table both have superuser rights. So request

SELECT CURRENT_USER(); 

gives the result

user @%,

and the trigger associated with the table contains the string:

/ *! 50017 DEFINER = 'root' @ '%' * /

While the mysql.user table contains the following entries:

enter image description here

What is the reason for the error?

  • Check the output of the SHOW GRANTS FOR 'root'@'%'; command SHOW GRANTS FOR 'root'@'%'; - Anton Shchyrov
  • Here it is: GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CURATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CURATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CURATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CURATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CURATE CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON . TO 'root' @ '%' IDENTIFIED BY PASSWORD '* ...' WITH GRANT OPTION - Ksenia
  • one
    As expected, TRIGGER privileges are not - Anton Shchyrov
  • @AntonShchyrov, thanks, really, the reason was this! If you write this as an answer, I will definitely accept :) - Ksenia
  • Designed a response - Anton Shchyrov

1 answer 1

View all permissions for user 'root'@'%' command

 SHOW GRANTS FOR 'root'@'%'; 

You will not have the privilege of TRIGGER. Add her team

 GRANT TRIGGER ON *.* TO 'root'@'%'; 

or grant all rights

 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;