centos5.5下如何安裝mysql HandlerSocket?
CentOS是RHEL(RedHatEnterpriseLinux)源代碼再編譯的產(chǎn)物,而且在RHEL的基礎(chǔ)上修正了不少已知的Bug,相對于其他Linux發(fā)行版,其穩(wěn)定性值得信賴。HandlerSocket是mysql的一個插件,具體的功能大家上網(wǎng)去查。現(xiàn)在記錄一下在centos5.5下安裝mysql HandlerSocket過程中遇到的一些問題:
1、HandlerSocket必需要在mysql5.1的版本上安裝
2、下載ahiguti-HandlerSocket-Plugin-for-MySQL-1.0.6-88-gefd9972.tar.gz
3、下載mysql5.1.58.tar.gz
4、按照正常的方法安裝mysql
一開始用這些參數(shù)編譯
- ./configure--prefix=/usr/local/mysql--with-extra-charsets=complex--with-mysqld-ldflags=-all-static--with-client-ldflags=-all-static
但是在安裝插件的時候就報”ERROR1289(HY000):The‘plugin’featureisdisabled;youneedMySQLbuiltwith‘HAVE_DLOPEN’tohaveitworking”,上網(wǎng)查了一下說要編譯前要運行下面命令:
- exportCFLAGS=”-O2-DHAVE_DLOPEN=1″
- exportCXXFLAGS=”-O2-DHAVE_DLOPEN=1″
運行完之后,編譯就沒有法編譯,后來需要把”–with-mysqld-ldflags=-all-static–with-client-ldflags=-all-static”這些靜態(tài)化的參數(shù)取消,才得以通過。
- ./configure--prefix=/usr/local/mysql--with-extra-charsets=complex--with-plugins=all--enable-thread-safe-client
5、安裝HandlerSocket
解壓,然后運行./autogen.sh
- cat/usr/share/aclocal/libtool.m4>>aclocal.m4
- ./configure--prefix=/usr/local/handlersocket--with-mysql-source=/root/mysql-5.1.58--with-mysql-bindir=/usr/local/mysql/bin--with-mysql-plugindir=/usr/local/mysql/lib/mysql/plugin
- make
- makeinstall
這樣它會在/usr/local/mysql/lib/mysql/plugin生成一些handlersocket文件
6、進入mysql,運行
- mysql>installpluginhandlersocketsoname'handlersocket.so';
7、vi/etc/my.cnf增加如下內(nèi)容:
- loose_handlersocket_port=9998
- #theportnumbertobindto(forreadrequests)
- loose_handlersocket_port_wr=9999
- #theportnumbertobindto(forwriterequests)
- loose_handlersocket_threads=16
- #thenumberofworkerthreads(forreadrequests)
- loose_handlersocket_threads_wr=1
- #thenumberofworkerthreads(forwriterequests)
- open_files_limit=65535
總結(jié):
希望本文介紹的centos5.5下安裝mysql HandlerSocket的內(nèi)容能夠?qū)ψx者有所幫助,更多有關(guān)linux系統(tǒng)的知識還有待于讀者去探索和學習。