1. 在Linux系统上安装Mysql-udf-http

ulimit -SHn
wget http://curl.haxx.se/download/curl-7.21.1.tar.gz
tar zxvf curl-7.21..tar.gz
cd curl-7.21./
./configure --prefix=/usr
make && make install
cd ../ echo "/usr/local/webserver/mysql/lib/mysql/" > /etc/ld.so.conf.d/mysql.conf
/sbin/ldconfig
wget http://mysql-udf-http.googlecode.com/files/mysql-udf-http-1.0.tar.gz
tar zxvf mysql-udf-http-1.0.tar.gz
cd mysql-udf-http-1.0/
./configure --prefix=/usr/local/webserver/mysql --with-mysql=/usr/local/webserver/mysql/bin/mysql_config
make && make install
cd ../

2. 通过命令行登陆进入MySQL

mysql -uroot -proot

3. 创建MySQL自定义函数

create function http_get returns string soname 'mysql-udf-http.so';
create function http_post returns string soname 'mysql-udf-http.so';
create function http_put returns string soname 'mysql-udf-http.so';
create function http_delete returns string soname 'mysql-udf-http.so';

注意: 在执行上述create操作是,若提示如下错误

create function http_get returns string soname 'mysql-udf-http.so';ERROR  (HY000): Can't find symbol 'http_get' in library

如果出现上述错误,原因是 /server/mysql/lib/plugin/mysql-udf-http.so 查看/server/mysql/lib/若存在mysql-udf-http.so.0.0.0则拷贝至plugin目录并更名为mysql-udf-http.so即可

4. 示例 A:

/* HTTP GET、POST方式提交关键词“xoyo”到百度移动搜索 */
SELECT http_get('http://m.baidu.com/s?word=xoyo&pn=0');
SELECT http_post('http://m.baidu.com/s','word=xoyo&pn=0'); /* 新浪微博开放平台:获取新浪用户ID为103500的最近一条微博内容 */
SELECT http_get('http://api.t.sina.com.cn/statuses/user_timeline/103500.json?count=1&source=1561596835') AS data;
/* 新浪微博开放平台:发表一条微博 */
SELECT http_post('http://your_sina_uid:your_password@api.t.sina.com.cn/statuses/update.xml?source=1561596835', 'status=Thins is sina weibo test information'); /* Tokyo Tyrant 写入、读取、删除操作 */
SELECT http_put('http://192.168.8.34:1978/key', 'This is value');
SELECT http_get('http://192.168.8.34:1978/key');
SELECT http_delete('http://192.168.8.34:1978/key');

本文参照: http://blog.s135.com/mysql-udf-http/2/1/

Mysql-udf-http 插件的安装与使用的更多相关文章

  1. centos7使用MySQL的Yum存储库安装mysql5.7.27

    下载yum源 官网地址:http://dev.mysql.com/downloads/repo/yum/ centos7系统: http://dev.mysql.com/get/mysql57-com ...

  2. MySQL中文全文索引插件 mysqlcft 1.0.0 安装使用文档[原创]

    [文章+程序 作者:张宴 本文版本:v1.0 最后修改:2008.07.01 转载请注明原文链接:http://blog.zyan.cc/post/356/] MySQL在高并发连接.数据库记录数较多 ...

  3. MySql UDF 调用外部程序和系统命令

    1.mysql利用mysqludf的一个mysql插件可以实现调用外部程序和系统命令 下载lib_mysqludf_sys程序:https://github.com/mysqludf/lib_mysq ...

  4. mysql udf提权实战测试

    根据前天对大牛们的资料学习,进行一次mysql udf提权测试. 测试环境: 受害者系统:centos 7.7 ,docker部署mysql5.6.46, IP:192.168.226.128 攻击者 ...

  5. Gearman + Nodejs + MySQL UDF异步实现 MySQL 到 Redis 的数据同步

    [TOC] 1, 环境 CentOS, MySQL, Redis, Nodejs 2, Redis简介 Redis是一个开源的K-V内存数据库,它的key可以是string/set/hash/list ...

  6. Navicat for MySQL之MySQL客户端的下载、安装和使用

    前期工作 若需使用Navicat for MySQL,则需要先安装MySQL,在此就不叙述了.具体可见我的博客: mysql-5.7.11-winx64.zip 的下载.安装.配置和使用(window ...

  7. Mysql 5.7 CentOS 7 安装MHA

    Table of Contents 1. MHA简介 1.1. 功能 1.2. MHA切换逻辑 1.3. 工具 2. 环境 2.1. 软件 2.2. 环境 3. Mysql 主从复制 3.1. Mys ...

  8. 【API】Mysql UDF BackDoor

    1.MySQL UDF是什么 UDF是Mysql提供给用户实现自己功能的一个接口,为了使UDF机制起作用,函数必须用C或C ++编写,并且操作系统必须支持动态加载.这篇文章主要介绍UDF开发和利用的方 ...

  9. MySQL 8.0.11(zip)安装及配置

    (1)下载MySQL8.0.11: (2)解压zip文件: 我解压到了D:/MySQL/mysql-8.0.11-winx64 (3)配置环境变量:   右键此电脑->属性 高级系统设置 环境变 ...

  10. MySQL审计工具Audit Plugin安装使用

    本实验的审计插件均是安装在 mysql-community-server-5.7.9 的服务器上. 插件安装(社区版) 插件下载地址: https://bintray.com/mcafee/mysql ...

随机推荐

  1. EJBCA认证系统结构及相关介绍

    写作此文的主要目的是记录下EJBCA认证系统的系统结构及相关部件作用的介绍,方便后面查阅使用.

  2. Mac上小巧实用的GIF格式录屏软件 LICEcap

    LICEcap 是一款小巧使用的Mac屏幕录制软件,它以GIF格式来录制屏幕内容,用户可以自定帧率和录制范围.这样就能控制生成文件的大小,非常便捷实用哦.点击进入下载 <ignore_js_op ...

  3. 使用JDom解析XML文档模拟Spring的配置文件解析

    在J2EE项目中可能会涉及到一些框架的使用,最近接触到了SSH,拿Spring来说配置文件的使用是相当重要的,Spring的配置文件是一个xml文件,Spring是如何读取到配置文件并进行依赖注入的呢 ...

  4. Cglib学习站点(转)

    1.CGlib简单介绍,访问地址:http://www.blogjava.net/stone2083/archive/2008/03/16 /186615.html,从简单的示例到不同业务场景的变化, ...

  5. python使用mysql的三个模块:mysql.connector、sqlalchemy、MySQLdb

    在python中使用mysql其实很简单,只要先安装对应的模块即可,那么对应的模块都有什么?官方也没指定也没提供,pcat就推荐自己遇到的3个模块:mysql.connector.sqlalchemy ...

  6. [LeetCode]题解(python):140-Word Break II

    题目来源: https://leetcode.com/problems/word-break-ii/ 题意分析: 给定一个字符串s和一个字典dict(set),将所有将s有字典dict组成的结果输出. ...

  7. PHP并发最佳实践

    直接参考大牛的: http://www.searchtb.com/2012/06/rolling-curl-best-practices.html

  8. UIWindow 详解

    UIWindow对象是所有UIView的根视图,管理和协调的应用程序的显示.分发事件给View.UIWindow类是UIView的子类,可以看作是特殊的UIView.一般应用程序只有一个UIWindo ...

  9. InnerException 消息是“反序列化对象 属于类型 *** 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。(注意细节)

    WEB站点在调用我们WCF服务的时候,只要传入的参数过长,就报如下错误: 格式化程序尝试对消息反序列化时引发异常: 尝试对参数 http://tempuri.org/ 进行反序列化时出错: formD ...

  10. WebRTC学习笔记_Demo收集

    1.     WebRTC学习 1.1   WebRTC现状 本人最早接触WebRTC是在2011年底,那时Google已经在Android源代码中增加了webrtc源代码,放在/external/w ...