handlersocket mysql,MySQL插件HandlerSocket

本文介绍了如何通过wget下载并安装MySQL的HandlerSocket插件,包括配置文件调整和插件加载步骤。同时,详细指导了如何在PHP中集成php-handlersocket模块,以利用其NoSQL功能进行数据库操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

HandlerSocket 是MySQL的一个插件,用来实现 NoSQL 功能,用于跳过MySQL的SQL层面,直接访问内部的InnoDB存储引擎。

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.11-1.rhel4.i386.rpm

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.11-1.rhel4.i386.rpm

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.11-1.rhel4.i386.rpm

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-shared-5.5.11-1.rhel4.i386.rpm

rpm -ivh MySQL-client-5.5.11-1.rhel4.i386.rpm MySQL-devel-5.5.11-1.rhel4.i386.rpm MySQL-server-5.5.11-1.rhel4.i386.rpm MySQL-shared-5.5.11-1.rhel4.i386.rpm

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.11.tar.gz

一、安装HandlerSocket

获取安装包:https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL.git

tar -zxvf ahiguti-HandlerSocket-Plugin-for-MySQL-1.0.6-73-g0e63366.tar.gz

cd ahiguti-HandlerSocket-Plugin-for-MySQL-0e63366/

./autogen.sh

./configure --with-mysql-source=/home/xinze/software/mysql-5.5.11 --with-mysql-bindir=/usr/bin --with-mysql-plugindir=/usr/lib/mysql/plugin

make && make install

修改/etc/my.cnf 配置

[mysqld]

plugin-load=handlersocket.so

loose_handlersocket_port = 9998 # 指定读请求端口号

# the port number to bind to (for read requests)

loose_handlersocket_port_wr = 9999 # 指定写请求端口号

# the port number to bind to (for write requests)

loose_handlersocket_threads = 16 # 指定读线程数目

# the number of worker threads (for read requests)

loose_handlersocket_threads_wr = 1 # 指定写线程数目

# the number of worker threads (for write requests)

open_files_limit = 65535

# to allow handlersocket accept many concurrent

# connections, make open_files_limit as large as

# possible.

在mysql里加载HandlerSocket插件:

mysql> INSTALL PLUGIN handlersocket SONAME "handlersocket.so";

mysql>SHOW PLUGINS; # 查看插件是否加载成

mysql>SHOW PROCESSLIST; # 查看handlersocket是否正常运行

* 如果SHOW PROCESSLIST没有handlersocket 进程, 则先关闭SELinux后再试试看看。

* 在ubuntu下,可以先 /etc/init.d/apparmor stop 然后重启MySQL, 然后 /etc/init.d/apparmor start

二、安装 php-handlersocket 模块:

wget http://php-handlersocket.googlecode.com/files/php-handlersocket-0.1.0.tar.gz

tar zxvf php-handlersocket-0.1.0.tar.gz

cd php-handlersocket

phpize

./configure

make

make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值