MySQL Proxy Download:http://dev.mysql.com/downloads/mysql-proxy/ MySQL Proxy Wiki:http://forge.mysql.com/wiki/MySQL_Proxy 1、lua 安装 Get lua from:http://www.lua.org/ 1. vi Makefile (将 "INSTALL_TOP= /usr/local" 变为 "INSTALL_TOP= /yourpath/lua") 2. make ansi 3. make install 2、GLib 安装 Get GLib from:http://www.gtk.org/ 1. ./configure --prefix=/yourpath/glib2 2. make 3. make install Note: newer version need newer pkg-conifg 0.xx Get pkg-config from:http://pkg-config.freedesktop.org/releases/ 1. ./configure 2. make 3. make install 3、libevent 安装 Get libevent from:http://monkey.org/~provos/libevent/ 1. ./configure --prefix=/yourpath/libevent 2. make;make install 4、check 安装 Get check lib from:http://check.sourceforge.net/ 1. ./configure --prefix=/yourpath/check 2. make 3. make install 5、MySQL Proxy 安装 编译前先要设置一下环境变量(export),类似于 Windows 下的 PATH 1. export LUA_CFLAGS="-I/yourpath/lua/include" LUA_LIBS="-L/yourpath/lua/lib -llua -ldl" LDFLAGS="-lm" 2. 3. export GLIB_CFLAGS="-I/yourpath/glib2/include/glib-2.0 -I/yourpath/glib2/lib/glib-2.0/include" 4. export GLIB_LIBS="-L/yourpath/glib2/lib -lglib-2.0" 5. 6. export CPPFLAGS="$CPPFLAGS -I/yourpath/libevent/include" 7. export CFLAGS="$CFLAGS -I/yourpath/libevent/include" 8. export LDFLAGS="$LDFLAGS -L/yourpath/libevent/lib -lm" 9. 10. ./configure --prefix=/yourpath/mysql-proxy --with-mysql=/yourpath/mysql --with-check=/yourpath/check 11. make 12. make install 测试是否安装成功,看下边这条语句是否可以正常输出 MySQL Proxy 的帮助 1. /yourpath/mysql-proxy/sbin/mysql-proxy --help-all |
转载于:https://blog.51cto.com/study86/1332232