The code tree of mysql proxy has been migrated to lauchpad and bazaar is used for version management. According to some documents, the latest mysql proxy is successfully compiled and installed under CentOS 5.2. The procedure record is as follows (it should also be applicable in centos 5 ):
First let the EPEL (Extra Packages for Enterprise Linux) repository take effect
# Rpm-Uvh http://download.Fedora.RedHat.com/pub/epel/5/i386/epel-release-5-2.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
$ Libevent-1.4.9-stable cd
$./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
$ Lua-5.1.4 cd
$ 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
$ Export PKG_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
$./Configure
$ Make
# Make install
After compilation is complete, check the final result:
# Mysql-proxy-V
Mysql-proxy 0.7.0
Glib2: 2.18.4
Libevent: 1.4.9-stable
Admin: 0.7.0
Proxy: 0.7.0
Configure the startup script to run mysql-proxy at system startup
Cd/etc/init. d
Wget http://customcode.googlecode.com/files/mysql-proxy
Chmod 0755/etc/init. d/mysql-proxy
Chkconfig mysql-proxy on
Add Operation Parameters
Cat>/etc/sysconfig/mysql-proxy
# Options 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
Author: Volcano published on March 14,200 9 at pm
Copyright information: this information can be reproduced at will. During reprinting, you must mark the original source and author information of the article in the form of hyperlinks and this statement.
Permanent Link-Http://www.ooso.net/archives/495