简体   繁体   中英

Problems installing and using Mysql-proxy in ubuntu 16.04

I have be stuck in this problem for over a week. I want to install mysql-proxy in ubuntu 16.04. I first downloaded Mysql-proxy0.8.5 source code and use ./autogen.sh to generate Makefile. But I get the error:

 tests/unit/Makefile.am:97: warning: source file         
 '$(top_srcdir)/src/network_mysqld_type.c' is in a subdirectory,
 tests/unit/Makefile.am:97: but option 'subdir-objects' is disabled

I tried to add AM_INIT_AUTOMAKE([subdir-objects]) but it did not work. Adding AUTOMAKE_OPTIONS = subdir-objects in Makefile.am do not work for me either. So I am not able to install mysql-proxy0.8.5 in ubuntu16.04 from source code.

I also tried to use the compiled version mysql-proxy-0.8.5-linux-glibc2.3-x86-64bit.tar.gz and wrote a simple mysql-proxy.cnf file:

[mysql-proxy]
plugins = proxy
event-threads = 4
proxy-lua-script = /home/casualet/tutorial-rewrite.lua 
proxy-address = 192.168.56.1:3307
proxy-backen-addresses = localhost:3306

and I give mysql-proxy.cnf chmod 0660; I used the command ./mysql-proxy --defaults-file=./mysql-proxy.cnf The proxy starts correctly, and I get:

2016-10-25: (critical) plugin proxy 0.8.5 started

when I used mysql client to connect to the proxy, I got:

we got a normal query: select @@version_comment limit 1 in the proxy and

Welcom to the MySQL monitor. Command end with ; or \\g in the client side.

However, when I issued command show databases; nothing happened, and the client got stuck. I thought tutorial-rewrite.lua may not suffice so I switch to another lua file, but I could still not execute my commands.

So, Do anyone have experience installing and using mysql-proxy in ubuntu? Thank you :)

I have found the solution to this problem. Just change the version of MySQL Client to 5.5.52 instead of using the default 5.7.15 in ubuntu 16.04.

There is so little related information online about how to use mysql-proxy, which makes me think that mysql-proxy is rarely used in production. I hope this post may help others facing similar problems.:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM