我可以在MySQL下直接在SQL中运行HTTP GET吗? [英] Can I run an HTTP GET directly in SQL under MySQL?

查看:150
本文介绍了我可以在MySQL下直接在SQL中运行HTTP GET吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这样做:

UPDATE table SET blobCol = HTTPGET(urlCol) WHERE whatever LIMIT n;

有没有可用的代码来执行此操作?我知道这应该是可能的,因为 MySQL文档包括添加添加执行DNS查找功能的示例.

Is there code available to do this? I known this should be possible as the MySQL Docs include an example of adding a function that does a DNS lookup.

MySQL/Windows/最好不用编译东西,但是我可以.

MySQL / windows / Preferably without having to compile stuff, but I can.

(如果您还没有听说过类似的消息,但是您希望它确实存在,那么不愿意"会很好.)

(If you haven't heard of anything like this but you would expect that you would have if it did exist, A "proly not" would be nice.)

我知道这将打开一个完整的can-o-worms再安全性,但是在我的情况下,对数据库的唯一访问是通过mysql控制台应用程序. 它不是世界可访问的系统.它不是网络后端.它是本地数据记录系统

I known this would open a whole can-o-worms re security, however in my cases, the only access to the DB is via the mysql console app. Its is not a world accessible system. It is not a web back end. It is only a local data logging system

推荐答案

不,谢谢,good—这将是一个安全恐怖.可以利用应用程序中的每个SQL注入漏洞来启动垃圾邮件连接攻击其他站点.

No, thank goodness — it would be a security horror. Every SQL injection hole in an application could be leveraged to start spamming connections to attack other sites.

我想,您可以用C编写它并将其编译为UDF.但是,与仅在应用程序层中进行SELECT并通过HTTP GET和UPDATE遍历结果相比,它并没有真正给您带来任何好处.如果我们正在谈论建立HTTP连接,那么无论如何网络延迟都会完全抵消在数据库层进行HTTP连接的额外效率.

You could, I suppose, write it in C and compile it as a UDF. But I don't think it really gets you anything in comparison to just SELECTing in your application layer and looping over the results doing HTTP GETs and UPDATEing. If we're talking about making HTTP connections, the extra efficiency of doing it in the database layer will be completely dwarfed by the network delays anyway.

这篇关于我可以在MySQL下直接在SQL中运行HTTP GET吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆