lang/php

php mysql handlrsocket

C/H 2013. 2. 5. 10:09

참고


sudo apt-get install mysql-server -y;
sudo apt-get install handlersocket-doc -y;
sudo apt-get install handlersocket-mysql-5.1 -y;
sudo apt-get install libhsclient-dev -y;
sudo vi /etc/mysql/my.cnf 
# under [mysqld] section
loose_handlersocket_port = 9998
loose_handlersocket_port_wr = 9999
loose_handlersocket_threads = 16
loose_handlersocket_threads_wr = 1
open_files_limit = 65535 

# mysql install plugin

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

tar -xvzf php-handlersocket-0.3.1.tar.gz

phpize
./configure  or  ./configure --disable-handlersocket-hsclient
make
sudo make install



mysql> install plugin handlersocket soname 'handlersocket.so';
ERROR 1126 (HY000): Can't open shared library 'handlersocket.so' (errno: 0 API version for DAEMON plugin is too different)

참고 : https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/blob/master/docs-en/protocol.en.txt

sudo apt-get install mysql-server

sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
sudo apt-get install libmysqld-dev
# 위 4개의 패키지가 설치 되어 있어야 합니다.

wget https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL/archive/master.zip
unzip DeNA.HandlerSocket-Plugin-for-MySQL.zip
sudo ./autogen.sh
sudo apt-get install dpkg-dev
# 소스 설치를 위해서 데비안 패키지 설치
 sudo apt-get source mysql-server
# mysql-5.5-5.5.29 소스 설치 
sudo ./configure --with-mysql-source=../mysql-5.5-5.5.29 --with-mysql-bindir=/usr/bin --with-mysql-plugindir=/usr/lib/mysql/plugin
sudo make
sudo make install

find / -name handlersocket.so
/usr/lib/mysql/plugin/handlersocket.so
sudo VI /etc/my.cnf
[mysqld]
Loose_handlersocket_port 9998
Loose_handlersocket_port_wr 9999
Loose_handlersocket_threads 16
Loose_handlersocket_threads_wr 1
Open_files_limit 65535
mysql -u root -p

mysql>  install plugin handlersocket soname'handlersocket.so';
Query OK, 0 rows affected (0.01 sec)
반응형