• gearman安装

apt-get install gearman gearman-server libgearman-dev

配置bindip

/etc/defalut/gearman-job-server

PARAMS="--listen=0.0.0.0"

/etc/init.d/gearman-job-server start
/etc/init.d/gearman-job-server status
* gearmand is running

mysql_config无就安装下面的
apt-get install libmysqld-dev libmysqlclient-dev

mysql 查找plugin目录:

 show variables like '%plugin%';

编译安装 udf

CPPFLAGS=" -Werror -Wno-unused-but-set-variable" ./configure --with-mysql=/usr/bin/mysql_config --libdir=/usr/lib/mysql/plugin

make install

Libraries have been installed in:
/usr/lib/mysql/plugin

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

安装函数UDF

CREATE FUNCTION gman_do RETURNS STRING
SONAME "libgearman_mysql_udf.so";
CREATE FUNCTION gman_do_high RETURNS STRING
SONAME "libgearman_mysql_udf.so";
CREATE FUNCTION gman_do_low RETURNS STRING
SONAME "libgearman_mysql_udf.so";
CREATE FUNCTION gman_do_background RETURNS STRING
SONAME "libgearman_mysql_udf.so";
CREATE FUNCTION gman_do_high_background RETURNS STRING
SONAME "libgearman_mysql_udf.so";
CREATE FUNCTION gman_do_low_background RETURNS STRING
SONAME "libgearman_mysql_udf.so";
CREATE AGGREGATE FUNCTION gman_sum RETURNS INTEGER
SONAME "libgearman_mysql_udf.so";
CREATE FUNCTION gman_servers_set RETURNS STRING
SONAME "libgearman_mysql_udf.so";

  • 配置GearmanIP

 SELECT gman_servers_set('127.0.0.1:4730');

CREATE FUNCTION json_array RETURNS STRING SONAME 'lib_mysqludf_json.so';
select * from mysql.func;
mysql> select * from mysql.func;
+--------------+-----+----------------------+----------+
| name | ret | dl | type |
+--------------+-----+----------------------+----------+
| json_array | 0 | lib_mysqludf_json.so | function |
| json_members | 0 | lib_mysqludf_json.so | function |
| json_values | 0 | lib_mysqludf_json.so | function |
+--------------+-----+----------------------+----------+

DROP FUNCTION json_array;

查看gearman队列

watch -n 1 "(echo status; sleep 0.1) | nc 127.0.0.1 4730"

gearman mysql udf的更多相关文章

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

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

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

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

  3. 【API】Mysql UDF BackDoor

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

  4. mysql udf提权实战测试

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

  5. MySQL UDF提权执行系统命令

    目录 UDF UDF提权步骤 UDF提权复现(php环境) UDF UDF (user defined function),即用户自定义函数.是通过添加新函数,对MySQL的功能进行扩充,其实就像使用 ...

  6. gearman mysql持久化

    gearman 创建Mysql持久化队列的方式如下: 启动gearman,命令如下: gearmand命令: -b, –backlog=BACKLOG 连接请求队列的最大值 -d, –daemon D ...

  7. linux mysql udf 提权

    连接远程数据库 查看插件库路径 show variables like '%plugin%'; 写入udf库到插件目录: 32位: select unhex('7F454C46020101000000 ...

  8. mysql UDF提权 sys_bineval

    介绍: 执行shellcode – sys_bineval sqmapl自带udf.dll中存在函数’sys_bineval,执行shellcode – sys_bineval 利用: MSF生成sh ...

  9. mysql UDF提权问题

    测试UDF提权,时候遇到问题,创建函数shell提示存在 当执行操作的时候又提示,shell函数不存在. FUNCTION mysql.shell does not exist 如果在测试环境下,一般 ...

随机推荐

  1. Mysql导入数据库的方法

    mysql导入数据库的方法 | 浏览:41023 | 更新:2012-11-01 19:45 1 2 3 4 5 6 7 分步阅读 MySQL是一个中.小型关系型数据库管理系统,由瑞典MySQL AB ...

  2. 一个关于AM335X比较全面的笔记博客

    http://www.eefocus.com/marianna/blog/cate_18142_0.html

  3. SGU196_Matrix Multiplication

    给一个无向图,如果第i个点连接第j条边,那么mat[i][j]=1,否则mat[i][j]=0. 求mat的转置乘以本身得到的矩阵每个位置的和是多少? 理解矩阵的意义就比较好做了. mat[i][j] ...

  4. oracle 游标使用大全

    转:http://www.cnblogs.com/fjfzhkb/archive/2007/09/12/891031.html oracle的游标和例子! 游标-----内存中的一块区域,存放的是se ...

  5. ASP通过代码绑定Gridview控件

    using System.Configuration;using System.Data.OleDb;using System.Data; public partial class datafilm ...

  6. Jade之Template Inheritance

    Template inheritance jade支持通过关键字block和extends来实现模板继承. 比如,在layout.jade写上如下代码 html head title My Site ...

  7. 获得select下拉框的值

    html -------------------------------------------------------------------------------------- <sele ...

  8. Python动态生成变量

    Python 也可以像javascript那样动态生成变量.我们看javascript的动态生成变量. var obj = {}; for (var i =0, len = 10; i < le ...

  9. Registered Nurse in the US

    注册护士移民美国的条件 美国护士RN考试介绍 美国注册护士考试复习 美国各州注册护士考试要求 CGFNS Registered nurse Top Paid Registered Nurses

  10. java反射保存

    前言 代码是我师父的,代码是我师父的,代码是我师父的,如有需要拿走的时候请标注  copyright by 山人Wu  记录这篇是为了加深理解,前段时间只是当做工具类来用,才有时间好好看一下,加深理解 ...