Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationEventAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.


RDSのmysqlでトリガーが作れない I couldn't create trigger in mysql RDS

I got dump file by using mysqldump, and tried to import it into mysql on RDS.
But, this error occurred.

/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `product_log` AFTER INSERT ON `product`
    INSERT INTO ........

In RDS, super privilege is unavailable. We need to change a parameter group.

ERROR 1419 (HY000) at line 3155: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

この状況を緩和するには、RDS カスタムパラメーターグループの log_bin_trust_function_creators システム変数に 1 を設定します。
To relax this condition, set the global log_bin_trust_function_creators system variables to 1 through the RDS custom parameter group.

But, the problem wasn't solved. the error below occurred in my case.

ERROR 1227 (42000) Access denied; you need (at least one of) the SUPER privilege(s) for this operation

If dumpfile includes DEFINER attribute, mysql tries to create trigger with the specified user in DEFINER attribute.
To solve this is that remove the DEFINER attribute.


My problem was solved by removal of this attribute!

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Help us understand the problem. What are the problem?