InCentos 1, 5.2Install the latestMysql Proxy LUAThe tutorial is the content to be introduced in this article.Mysql Proxy LUAThe installation process is described in detail in this article.
Mysql proxyThe code tree has been migrated to lauchpad, and bazaar is used for version management. For more information, seeCentos 1, 5.2Latest compilation and InstallationMysql proxySuccessful. The procedure record should also be applicable in centos 5 as follows ):
First let the EPEL (Extra Packages for Enterprise Linux) repository take effect
- #rpm -Uvhhttp://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Make sure these packages have been installed: GNU Autotools, flex, pkg-config, bazaar, MySQL client libraries
- yum install autoconf automake libtool flex pkgconfig bzr mysql-devel
The libevent version that comes with centos is too old. There is no other way to compile it by yourself. The version must be later than 1.4.0. The higher the version, the better.
- wget http://monkey.org/~provos/libevent-1.4.9-stable.tar.gz
- tar zvfx libevent-1.4.9-stable.tar.gz
- cd libevent-1.4.9-stable
- /configure
- make
- make install
The glib version that comes with centos is also relatively old. mysql proxy 0.7.0 or above requires glib2 later than .0 to be compiled successfully, so you have to re-compile glib
- wget http://ftp.gnome.org/pub/gnome/sources/glib/2.18/glib-2.18.4.tar.gz
- tar zvfx glib-2.18.4.tar.gz
- cd glib-2.18.4
- /configure
- make
- make install
Compile and install lua 5.1
- wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
- tar zvfx lua-5.1.4.tar.gz
- cd lua-5.1.4
- vi src/Makefile
Add-fPIC to CFLAGS because the "relocations" error occurs during compilation on 64-bit machines.
- make linux
- make install
- cp etc/lua.pc /usr/local/lib/pkgconfig/
Important: Let pkg-config find the library you have compiled
- $exportPKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
Finally, check out the latest mysql-proxy source file from bazaar for compilation:
- bzr branch lp:mysql-proxy
- cd mysql-proxy
- /autogen.sh
Error message:
- configure.in:10: require Automake 1.10, but have 1.9
No solution found
- /configure
- make
- make install
Install mysql-proxy using source code
- wget http://launchpad.net/mysql-proxy/0.8/0.8.0/+download/mysql-proxy-0.8.0.tar.gz
-
- tar zxvf mysql-proxy-0.8.0.tar.gz
- cd mysql-proxy-0.8.0
- /configure
- make
- make install
After compilation is complete, check the final result:
- mysql-proxy -V
- mysql-proxy 0.8.0
- glib2: 2.18.4
- libevent: 2.0.10-stable
- lua: Lua 5.1.4
- LUA_PATH: /usr/local/lib/mysql-proxy/lua/?.lua
- LUA_CPATH: /usr/local/lib/mysql-proxy/lua/?.so
- == plugins ==
- admin: 0.7.0
-
- proxy: 0.7.0
Configure the startup script to run mysql-proxycd/etc/init. d at system startup.
- wget http://customcode.googlecode.com/files/mysql-proxy
-
- chmod0755/etc/init.d/mysql-proxy
- chkconfig mysql-proxy on
Add Operation Parameters
- cat>/etc/sysconfig/mysql-proxyOptions to mysql-proxy
- do not remove --daemon
- PROXY_OPTIONS="--daemon"
CTRL + D save, then you can start | stop mysql-proxy
- /etc/init.d/mysql-proxy start|stop
Troubleshooting
1,
- /etc/init.d/mysql-proxy
- bash: /etc/init.d/mysql-proxy: /bin/bash^M: bad interpreter: No such file or directory
Execute any command to convert mysql-proxy to unxi format
- #dos2unxi /etc/init.d/mysql-proxy
- #vi /etc/init.d/mysql-proxy
- set ff=unix
2,
- make[2]: *** [lua.o] Error 1
- make[2]: Leaving directory `/software/lua-5.1.4/src'
- make[1]: *** [linux] Error 2
- make[1]: Leaving directory `/software/lua-5.1.4/src'
- make: *** [linux] Error 2
Solution:
- #yum -y install libtermcap-devel ncurses-devel ncurses-devel ncurses-devel
3,
- gconvert.c:55:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv
Summary:Centos 1, 5.2Install the latestMysql Proxy LUAThe content of this tutorial has been introduced. I hope this article will help you!