Bug #47451 Connection fails when connecting to 'localhost'.
Submitted: 19 Sep 2009 9:34 Modified: 16 Oct 2009 6:37
Reporter: Libing Song Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / C Severity:S3 (Non-critical)
Version:5.4 OS:Linux
Assigned to: CPU Architecture:Any

[19 Sep 2009 9:34] Libing Song
Description:
Slave I/O thread can't connect to master if master_host is 'localhost' on my computer, however Slave I/O thread can successfully connect to master if master_host is '127.0.0.1'. 
This error happens when '::1     localhost' is added into /etc/hosts.
'::1' is IPV6 address. Both 'localhost' and '127.0.0.1' work well when I has remove the entry from /etc/hosts.

However, Bug#42984 happens on one PB2 machine(techra47.norway.sun.com) even there is no IPV6 address. Bug#42984 must be having the same cause with this bug.

How to repeat:
1. your machine must support IPV6.
2. Add '::1     localhost' into /etc/hosts.
3. STOP SLAVE.
4. CHANGE MASTER TO master_host='localhost';
5. START SLAVE;

I cannot repeat it by using mysql client tools(eg. mysqlshow), because SLAVE I/O threat has a interval of timeout but mysql client tools don't have.
These tools will fail if mysql->options.connect_timeout is assign a value larger  than 0.
[13 Oct 2009 12:16] Tonci Grgin
Hi Libing and thanks for your report.

I think it's to do with client library and not connector. If you agree, I'd like to close this report as a duplicate of Bug#37267.
[16 Oct 2009 6:35] Libing Song
Hi Tonci Grgin,

I agree with you.
[16 Oct 2009 6:37] Tonci Grgin
Closed as duplicate of Bug#37267.