Bug #76512 Explicit --port option should imply --protocol=tcp
Submitted: 27 Mar 2015 18:41
Reporter: Todd Farmer (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[27 Mar 2015 18:41] Todd Farmer
Description:
The MySQL command-line clients prefer socket connections on linux when connecting to "localhost".  This is true even when an explicit --port argument is supplied.  A consequence of this is that, in an environment where multiple mysqld instances are running, users may inadvertently connect to the wrong instance, even when the port of the intended instance is specified.

How to repeat:
* Start two instances of mysqld on linux
* Start mysql with --port argument for each instance
* Note that you are connected to the same instance

Suggested fix:
When --port option is explicitly defined (either as command-line option or in options file), use --protocol=tcp.

Not related reports:

https://bugs.mysql.com/bug.php?id=43064
https://bugs.mysql.com/bug.php?id=31002
https://bugs.mysql.com/bug.php?id=31577
[27 Mar 2015 18:58] Todd Farmer
That should read, "NOTE related reports", rather than "not related reports."