CentOS是RHEL(RedHatEnterpriseLinux)源代码再编译的产物,而且在RHEL的基础上修正了不少已知的Bug,相对于其他Linux发行版,其稳定性值得信赖。HandlerSocket是mysql的一个插件,具体的功能大家上网去查。现在记录一下在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
一开始用这些参数编译
- ./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”,上网查了一下说要编译前要运行下面命令:
- exportCFLAGS=”-O2-DHAVE_DLOPEN=1″
- exportCXXFLAGS=”-O2-DHAVE_DLOPEN=1″
运行完之后,编译就没有法编译,后来需要把”–with-mysqld-ldflags=-all-static–with-client-ldflags=-all-static”这些静态化的参数取消,才得以通过。
- ./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增加如下内容:
- 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
总结:
希望本文介绍的centos5.5下安装mysql HandlerSocket的内容能够对读者有所帮助,更多有关linux系统的知识还有待于读者去探索和学习。