CREATE TRIGGER in an rds DB

amazon-rdstriggers

I'm trying to create a trigger on a table in my Amazon RDS database, and I can't seem to make it happen.

I tried to create a trigger on a table in the mysql client I use (Navicat), and got the error that I needed the SUPER privilege to do so. After some searching, I found that you could SET GLOBAL log_bin_trust_function_creators = 1 to get around this. I tried that using these instructions: http://getasysadmin.com/2011/06/amazon-rds-super-privileges/ (and then restarting the DB server for good measure), but no luck.

I also tried creating the trigger and setting the variable via the mysql commmand line to make sure Navicat wasn't adding anything unwanted to my sql commands, but that failed, too. It also seems from searching that there's no way to grant yourself the SUPER privilege.

So … is creating a trigger possible in RDS?

Best Answer

Its easy!

Open the RDS web console.

Open the “Parameter Groups” tab.

Create a new Parameter Group. On the dialog, select the MySQL family compatible to your MySQL database version, give it a name and confirm.

Select the just created Parameter Group and issue “Edit Parameters”.

Look for the parameter ‘log_bin_trust_function_creators’ and set its value to ’1′.

Save the changes.

Open the “Instances” tab. Expand your MySQL instance and issue the “Instance Action” named “Modify”.

Select the just created Parameter Group and enable “Apply Immediately”.

Click on “Continue” and confirm the changes.

Again, open the “Instances” tab. Expand your MySQL instance and issue the “Instance Action” named “Modify”.

Dont forget: Open the “Instances” tab. Expand your MySQL instance and issue the “Instance Action” named “Reboot”.

Via - http://techtavern.wordpress.com/2013/06/17/mysql-triggers-and-amazon-rds/

Related Topic