简体   繁体   中英

Is it possible to use MySQL UDF on Amazon RDS?

I need to send an HTTP request when a database changes, so I am using the mysqludf extension.

It works locally, but how can I get it working on Amazon RDS too? If it's not possible, I need a solution to use a MySQL trigger together with the sys_exec function or something similar.

Can someone can help me?

Thanks!

Definitely not. RDS instances are locked down in two ways that prevent you from installing UDFs; not to be confused with a stored functions, UDFs are written in C and compiled. The binary shared object file then has to be copied to the filesystem of the MySQL Server, which is not accessible to you with RDS (that's one) and you have to have the SUPER privilege to actually load the UDF plugin from the file, which RDS does not provide (that's two).

Additionally, you can't use sys_exec() or sys_eval() on RDS, because those functions aren't built-in. They're UDF plugins, too.

This is one of the tradeoffs with RDS (or any "managed" database server service, I suspect). In exchange for simplicity and point & click provisioning, there are some things that you give up.

There is not a way to do what you want, in RDS.

If your final requirement is to call some external API by taking a trigger from some sql operation on RDS database, you can leverage AWS SNS and lambda to achieve this. Its not a straight road,but will serve the purpose. In fact I have used this workaround to meet one of my requirement. You can find the thread here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM