Bug #34222 mysql-proxy can't resolve hostnames
Submitted: 1 Feb 2008 10:55 Modified: 29 Jun 2009 18:39
Reporter: Bartłomiej Syryjczyk Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Proxy: Core Severity:S4 (Feature request)
Version:revision 369, 0.7.1 OS:Linux (2.6.24-gentoo-r3)
Assigned to: Assigned Account CPU Architecture:Any
Tags: mysql-proxy
Triage: D5 (Feature request)

[1 Feb 2008 10:55] Bartłomiej Syryjczyk
Description:
mysql-proxy can't resolve hostnames. When I run mysql-proxy with hostname as proxy-backend-addresses, I've go this errors:
---
2008-02-01 11:50:05: (critical) network-mysqld.c.384: network_mysqld_con_set_address(method) failed: address has to be <ip>:<port> for TCP or a absolute path starting with / for Unix sockets
2008-02-01 11:50:05: (critical) network-mysqld.c.1226: plugin_call(CON_STATE_INIT) != RET_SUCCESS
---
When I try to connect to mysql-proxy I've got this error:
---
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
---
It will be nice if TCP address can be not only <ip>:<port>.

How to repeat:
# mysql-proxy --proxy-backend-addresses=<hostname>
[25 Mar 2008 0:29] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Have you specified port #?

Like:  mysql-proxy --plugins=proxy --proxy-backend-addresses=apple:3306
[25 Mar 2008 7:04] Bartłomiej Syryjczyk
With port (eg. mysql:3306) works fine. But Unix socket is absolute path starting with /.
[31 Mar 2008 9:23] Sveta Smirnova
Thank you for the feedback.

With UNIX socket everything works fine for me too:

$mysql-proxy  --proxy-backend-addresses=/tmp/mysql.sock --daemon --plugins=proxy

$mysql -P4040 -happle
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1741
Server version: 5.0.51a-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select 1;
+---+
| 1 |
+---+
| 1 | 
+---+
1 row in set (0.18 sec)

mysql> \q
Bye

Or do you want mysql-proxy support syntax like:

$mysql-proxy  --proxy-backend-addresses=apple

without specifying port #?
[31 Mar 2008 11:00] Bartłomiej Syryjczyk
I want to mysql-proxy support syntax without specifying port # (this is natural).
[31 Mar 2008 11:05] Sveta Smirnova
Thank you for the explanation.

Verified as described.
[3 Jun 2009 13:57] Kay Roepke
This problem persists in 0.7.1, but instead of taking the default proxy port (currently still 4040) it tries to use 3306 which is a bug, too.

classdump:trunk kroepke$ ./sbin/mysql-proxy --proxy-address=localhost
2009-06-03 15:34:38: (critical) ../../src/network-socket.c:503: bind(127.0.0.1:3306) failed: Address already in use (48)