[英]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. 我想在ubuntu 16.04中安装mysql-proxy。 I first downloaded Mysql-proxy0.8.5 source code and use ./autogen.sh to generate Makefile. 我首先下载了Mysql-proxy0.8.5源代码,并使用./autogen.sh生成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. 我试图添加AM_INIT_AUTOMAKE([subdir-objects]),但是它不起作用。 Adding AUTOMAKE_OPTIONS = subdir-objects in Makefile.am do not work for me either. 在Makefile.am中添加AUTOMAKE_OPTIONS = subdir-objects对我也不起作用。 So I am not able to install mysql-proxy0.8.5 in ubuntu16.04 from source code. 所以我不能从源代码在ubuntu16.04中安装mysql-proxy0.8.5。
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-0.8.5-linux-glibc2.3-x86-64bit.tar.gz,并编写了一个简单的mysql-proxy.cnf文件:
[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; 我给mysql-proxy.cnf chmod 0660; I used the command ./mysql-proxy --defaults-file=./mysql-proxy.cnf The proxy starts correctly, and I get: 我使用命令./mysql-proxy --defaults-file =。/ mysql-proxy.cnf代理正确启动,我得到:
2016-10-25: (critical) plugin proxy 0.8.5 started 2016-10-25 :(关键)插件代理0.8.5开始
when I used mysql client to connect to the proxy, I got: 当我使用mysql客户端连接到代理时,我得到了:
we got a normal query: select @@version_comment limit 1 in the proxy and 我们得到一个正常的查询:在代理中选择@@ version_comment限制1并
Welcom to the MySQL monitor. 欢迎使用MySQL监视器。 Command end with ; 命令以;结尾 or \\g in the client side. 或\\ g在客户端。
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. 我以为tutorial-rewrite.lua可能不够用,所以我切换到另一个lua文件,但仍然无法执行命令。
So, Do anyone have experience installing and using mysql-proxy in ubuntu? 那么,有没有人有在ubuntu中安装和使用mysql-proxy的经验? 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. 只需将MySQL Client的版本更改为5.5.52,而不是在Ubuntu 16.04中使用默认的5.7.15 。
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. 在线上关于如何使用mysql-proxy的相关信息很少,这使我认为mysql-proxy在生产中很少使用。 I hope this post may help others facing similar problems.:) 我希望这篇文章可以帮助其他面临类似问题的人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.