centos 6.2 为mysql5.6.10安装 HandlerSocket插件

时间:2022-09-14 15:52:16

环境:

系统centos6.2

mysql版本mysql5.6.10

HandlerSocket插件版本 1.1.1 (mysql5.6.10安装1.0的插件报错)

1.1.1版本地址https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL


首先安装mysql确保可以正常运行

/usr/sbin/groupadd

/usr/sbin/useradd -g mysql mysql

mkdir -p /data

mkdir -p /data/data/

chown mysql:root /data

yum -y install cmake bison bc ncurses ncurses-devel

wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.12.tar.gz

tar zxvf mysql-5.6.12.tar.gz

cd mysql-5.6.12

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/data/mysql.sock -DMYSQL_DATADIR=/data/data -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=1 -DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1

make

make install

cd ..

chmod +w /usr/local/mysql

chown -R mysql:mysql /usr/local/mysql


然后安装插件

unzip HandlerSocket-Plugin-for-MySQL-master.zip  (注意:版本是1.1.1)

cd HandlerSocket-Plugin-for-MySQL-master

./autogen.sh

./configure --with-mysql-source=/web/src/mysql-5.6.10/ --with-mysql-bindir=/usr/local/mysql/bin/ --with-mysql-plugindir=/usr/local/mysql/lib/plugin/ --prefix=/usr/local/HandlerSocket

make

make install


注释: --with-mysql-source=/web/src/mysql-5.6.10/  #MYSQL的安装源码目录,来自mysql-5.6.10.tar.gz的解压

注释: --with-mysql-bindir=/usr/local/mysql/bin/   #MYSQL安装目录里的BIN目录.

注释: --with-mysql-plugindir=/usr/local/mysql/lib/plugin/  #MYSQL安装目录里的PLUGIN的目录

注释:  --prefix=/usr/local/HandlerSocket  #HandlerSocket插件的安装目录


安装完毕以后 修改/etc/my.cnf配置文件

[root@WEB-C src]# cat /etc/my.cnf

[mysqld]

datadir=/data/data/

pid-file=/data/mysqld.pid

#socket=/var/lib/mysql/mysql.sock

socket=/data/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

-----------此部分是新添加内容----------------------

plugin-load=handlersocket.so

loose_handlersocket_port = 9998

loose_handlersocket_port_wr = 9999

loose_handlersocket_threads = 16

loose_handlersocket_threads_wr = 1

open_files_limit = 65535

-----------------------------------------

[mysqld_safe]

log-error=/data/binlog/mysqld.log


可以去参考一下文章:

http://blog.csdn.net/zzq900503/article/details/12969091

http://www.livingelsewhere.net/tag/handlersocket/

本文出自 “求学” 博客,转载请与作者联系!