Triggers in MySQL


#1

Can we create triggers in our MySQL5 databases? I just tried and got this error message:

Access denied; you need the SUPER privilege for this operation

The SQL code I used to generate this error is (I actually want it to insert into several other tables, too, and only do so under certain conditions- so this is a simpler version of the trigger):

CREATE
TRIGGER NewGameChar after Insert
ON GREntName FOR EACH ROW
Insert Into GRGameChar (EntId) Values (New.EnNameId);

I tried exploring the control panel, searching the forums and wiki for info on MySQL triggers or privilege levels, or just skimming through the posts, and I don’t see anything on the topic.

Is this something we cannot do due to the shared hosting setup? If so, is it possible to have a custom trigger implemented upon request? I can understand if triggers are not measured with other types of queries and this might be a billing concern. Perhaps this could be solved by having the trigger call a stored procedure or something?

Any guidance on this is greatly appreciated. I really like being able to set up triggers.


#2

I too have a use for a rather simple trigger. This is actually one of my primary reasons for using MySQL 5. I understand there are good reasons for restricting privileges. If there is a prescribed method of either granting or requesting normally restricted features, this information would be helpful to add to the wiki.


#3

I emailed support about this and this was their reply.

“Sorry but we currently do not support triggers … When the next major mysql version is related, 5.1.x, it will have a privilege just for triggers and after testing and upgrading we will likely support them, but it is pretty far in the future.”

So I guess we’re left with workarounds until then.


#4

Well, I’m trying to use a cron job to call a stored procedure in MySQL as a workaround, but having difficulty. Decided that the details would be too far off topic for this thread, so I’m posting a new thread. Based on DH’s e-mail response (what we should have expected, I guess), not much more to it for a while to come.

Thanks!