源码从代码仓库下载到本地
git clone git@github.com:Meituan-Dianping/DBProxy.git
编译源码并安装(添加新文件和修改版本的时候需要运行autogen.sh,注意docker centos:6.6 image下运行autogen.sh会失败)
sh autogen.sh sh bootstrap.sh make && make install |
执行sh bootstrap.sh 报错
修改 bootstrap.sh 成下面这个样子
#!/bin/sh base=$(cd "$(dirname "$0")"; pwd) cd $base ./configure --with-mysql=/usr/local/mysql/bin/mysql_config --prefix=/usr/local/mysql-proxy CFLAGS="-s -O0" CPPFLAGS="-I/usr/local/mysql/include/" LDFLAGS="-lm -ldl -lcrypto -ljemalloc" LUA_CFLAGS="-I/usr/include/" LUA_LIBS="-L/usr/lib64 -llua" |
执行 make && make install的时候报错
network-mysqld-packet.c: In function 'network_mysqld_auth_challenge_new': network-mysqld-packet.c:1470:9: error: 'CLIENT_SECURE_CONNECTION' undeclared (first use in this function) CLIENT_SECURE_CONNECTION | ^ network-mysqld-packet.c:1470:9: note: each undeclared identifier is reported only once for each function it appears in network-mysqld-packet.c: In function 'network_mysqld_proto_get_auth_challenge': network-mysqld-packet.c:1583:31: error: 'CLIENT_SECURE_CONNECTION' undeclared (first use in this function) if (shake->capabilities & CLIENT_SECURE_CONNECTION) { ^ network-mysqld-packet.c: In function 'network_mysqld_auth_response_new': network-mysqld-packet.c:1695:26: error: 'CLIENT_SECURE_CONNECTION' undeclared (first use in this function) auth->capabilities = CLIENT_SECURE_CONNECTION | CLIENT_PROTOCOL_41; ^ network-mysqld-packet.c: In function 'network_mysqld_proto_get_auth_response': network-mysqld-packet.c:1772:34: error: 'CLIENT_SECURE_CONNECTION' undeclared (first use in this function) if (auth->capabilities & CLIENT_SECURE_CONNECTION) { |
http://blog.51cto.com/hnr520/1887750