centos6.4 Minimum System
Install the build environment: yum-y Groupinstall "Development Tools" "Server Platform Development"
Since Mysql-proxy is a LUA-based script, you should install LUA before installing Mysql-proxy, which is a compile-and-install
Lua-5.1.5.tar.gz
Tools are placed in the/root directory
Cd/root
Tar XF lua-5.1.5.tar.gz
CD lua-5.1.5
[[email protected] lua-5.1.5]# ls
COPYRIGHT doc etc history INSTALL Makefile README src test
[Email protected] lua-5.1.5]# VI Makefile
Replace the install_top=/usr/local/with the
install_top=/usr/local/lua
[Email protected] lua-5.1.5]# CD src/
[Email protected] src]# VI Makefile
Replace cflags=-o2-wall $ (mycflags) with
Cflags=-o2-wall-fpic $ (mycflags) Otherwise the error will be reported (the data is based on 64-bit system)
cd/root/lua-5.1.5
Make Linux Install
Since Lua is compiled with a dependency on readline, it is necessary to install ReadLine
Yum-y Install ReadLine Readline-devel
After installation, continue to install LUA, and you can finally succeed.
##################################################################
Next Compile and install mysql-proxy-0.8.3.tar.gz
Cd/root
Tar XF mysql-proxy-0.8.3.tar.gz
CD mysql-proxy-0.8.3
./configure ldflags= "-LM-LDL" lua_cflags= "/usr/local/lua/bin/lua-i/usr/local/lua/include" LUA_LIBS= "/usr/local/ Lua/lib-llua "--with-mysql=/usr/local/mysql/bin/mysql_config--prefix=/usr/local/mysql-proxy
Error when compiling: dependent on Libevent,glib
Yum-y Install libevent libevent-devel glib*
Continue compiling, after success
Make
After a period of time, an error occurs and the installation is continued according to the error message libtool*
Then proceed with the installation
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/B8/wKiom1cqBL6z1z4HAAApary9z1w303.png "title=" Llua.png "alt=" Wkiom1cqbl6z1z4haaapary9z1w303.png "/>
Said to be unable to find the library file, and then found in the/usr/lib64 under the lua-5.1.so file, so look for information may be another reason Devel package may
Yum-y Install Lua-devel
Make again after execution, finally succeeded, finally make install
[Email protected] mysql-proxy-0.8.3]#/usr/local/mysql-proxy/bin/mysql-proxy-v
Mysql-proxy 0.8.3
Chassis:mysql-proxy 0.8.3
glib2:2.28.8
Libevent:1.4.13-stable
Lua:lua 5.1.5
Package.path:/usr/local/mysql-proxy/lib/mysql-proxy/lua/? Lua
Package.cpath:/usr/local/mysql-proxy/lib/mysql-proxy/lua/? So
--Modules
proxy:0.8.3
At this point, Mysql-proxy compiled and installed successfully, the dependencies of which really need to explore
Some of the Mysql-proxy configuration, as well as the startup script reference are as follows:
Http://heylinux.com/archives/1004.html
Mysql-proxy read-write separation based on mysql5.6 master-slave replication