Msyql-proxy的编译安装
2010-05-17 15:54
351 查看
p.MsoNormal,li.MsoNormal,div.MsoNormal { margin: 0cm; margin-bottom: .0001pt; text-align: justify; font-size: 10.5pt; font-family: "Times New Roman" }
a:link,span.MsoHyperlink { color: blue; text-decoration: underline }
a:visited,span.MsoHyperlinkFollowed { color: purple; text-decoration: underline }
div.Section1 { }
Msyql-proxy的编译安装
系统环境
操作系统:Centos
5.4
下载软件包:
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
wget http://monkey.org/~provos/libevent--stable.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/glib/2.18/glib-.tar.gz
wget http://www.lua.org/ftp/lua-.tar.gz
wget http://mysql.cdpa.nsysu.edu.tw/Downloads/MySQL-Proxy/mysql-proxy-0.7.1.tar.gz
yum install libtermcap-devel ncurses-devel
libevent-devel readline-devel
安装pkg-config
:
tar zxvf pkg-config-0.23.tar.gz
cd pkg-config-0.23
./configure
make
make install
确保PKG_CONFIG_PATH环境变量包含了相关的pkg-config配置文件路径:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
安装libevent
:
tar zxvf libevent--stable.tar.gz
cd libevent-1.4.9-stable
./configure
make
make install
安装glib :
tar zxvf glib-.tar.gz
cd glib-2.18.4
./configure
make
make install
安装lua :
tar zxvf lua-.tar.gz
cd lua-5.1.4
如果你的服务器是64位的,这时要调整一下Makefile:vi src/Makefile,在CFLAGS里加上-fPIC ,否则会出错:
/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o):
relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a
shared object;
recompile with –fPIC
/usr/local/lib/liblua.a: could not read
symbols: Bad value
接下来不用执行常见的configure,直接make:
make linux
make install
安装pkg-config配置文件,以便编译mysql-proxy时能找到lua:
cp etc/lua.pc /usr/local/lib/pkgconfig/lua5.1.pc
如果没有执行此步骤的话,在后面编译安装mysql-proxy的时候,会得到类似下面的错误信息:
Package lua5.1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua5.1' found
安装mysql-proxy
:
tar zxvf mysql-proxy-.tar.gz
cd mysql-proxy-0.7.0
./configure
make
make install
搞定了,测试一下:/usr/local/sbin/mysql-proxy
–V
启动mysql-proxy
/usr/local/sbin/mysql-proxy
--proxy-backend-addresses=192.168.1.103:3306 &
使用proxy访问mysql
Mysql –h192.168.1.103 –P4040 –uzhang -p
a:link,span.MsoHyperlink { color: blue; text-decoration: underline }
a:visited,span.MsoHyperlinkFollowed { color: purple; text-decoration: underline }
div.Section1 { }
Msyql-proxy的编译安装
系统环境
操作系统:Centos
5.4
下载软件包:
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
wget http://monkey.org/~provos/libevent--stable.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/glib/2.18/glib-.tar.gz
wget http://www.lua.org/ftp/lua-.tar.gz
wget http://mysql.cdpa.nsysu.edu.tw/Downloads/MySQL-Proxy/mysql-proxy-0.7.1.tar.gz
yum install libtermcap-devel ncurses-devel
libevent-devel readline-devel
安装pkg-config
:
tar zxvf pkg-config-0.23.tar.gz
cd pkg-config-0.23
./configure
make
make install
确保PKG_CONFIG_PATH环境变量包含了相关的pkg-config配置文件路径:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
安装libevent
:
tar zxvf libevent--stable.tar.gz
cd libevent-1.4.9-stable
./configure
make
make install
安装glib :
tar zxvf glib-.tar.gz
cd glib-2.18.4
./configure
make
make install
安装lua :
tar zxvf lua-.tar.gz
cd lua-5.1.4
如果你的服务器是64位的,这时要调整一下Makefile:vi src/Makefile,在CFLAGS里加上-fPIC ,否则会出错:
/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o):
relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a
shared object;
recompile with –fPIC
/usr/local/lib/liblua.a: could not read
symbols: Bad value
接下来不用执行常见的configure,直接make:
make linux
make install
安装pkg-config配置文件,以便编译mysql-proxy时能找到lua:
cp etc/lua.pc /usr/local/lib/pkgconfig/lua5.1.pc
如果没有执行此步骤的话,在后面编译安装mysql-proxy的时候,会得到类似下面的错误信息:
Package lua5.1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua5.1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua5.1' found
安装mysql-proxy
:
tar zxvf mysql-proxy-.tar.gz
cd mysql-proxy-0.7.0
./configure
make
make install
搞定了,测试一下:/usr/local/sbin/mysql-proxy
–V
启动mysql-proxy
/usr/local/sbin/mysql-proxy
--proxy-backend-addresses=192.168.1.103:3306 &
使用proxy访问mysql
Mysql –h192.168.1.103 –P4040 –uzhang -p
相关文章推荐
- (一)CentOS6.4 源码编译安装msyql5.6.17
- pl/proxy-2.5安装在postgresql9.6上无法编译
- mysql-proxy编译安装
- ReSIProcate之编译、安装、配置、运行、测试proxy
- Ubuntu 12.04.1 编译安装 Tinyproxy socks 版本
- zabbix-proxy编译安装
- apache单独编译添加proxy编译安装
- nginx-1.2.7 + tcp_proxy_module手动编译安装
- msyql编译安装
- nginx-1.4.4 + tcp_proxy_module手动编译安装
- 安装交叉调试器gdb,编译出错cc1: warnings being treated as errors
- android studio 3.0 编译的apk安装失败(-15)
- 针对用编译的方式安装时的卸载
- 第一节:Java SE入门、JDK的下载与安装、第一个Java程序、Java程序的编译与执行
- Redhat 7.2 编译安装PostgreSQL 10
- fedora 64位系统下编译安装wget
- Ubuntu16.04+Cuda8.0+Caffe+ Opencv3.2+Matlab2015b的配置、安装与编译(四)
- 新安装CCS 后编译出现问题:gmake:No rule to make target clean
- MySQL数据库优化推荐的编译安装参数小结
- 在ubuntu上编译boost,boost的安装目录设置