Bug #93456 Ignores port for second connection over SSH tunnel
Submitted: 3 Dec 2018 17:09 Modified: 4 Dec 2018 14:57
Reporter: Vasiliy Zverev Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.11 OS:Windows (Microsoft Windows 10 Pro)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[3 Dec 2018 17:09] Vasiliy Zverev
Description:
If you have two MySQL Connections using "Standard TCP/IP over SSH" to the same SSH Hostname and same MySQL Hostname but different MySQL ports, and you open these two connections in different tabs, second connection will connect to MySQL server from first connection ignoring difference in MySQL ports. You can even set non-existent port for second connection.

How to repeat:
I think local MySQL server is enough to repeat it. Just use SSH tunnel for connection.
1) create MySQL Connection in MySQL Workbench as "Standard TCP/IP over SSH".
Set proper 
SSH Hostname,
SSH Username,
SSH Key File
MySQL Hostname (it was 127.0.0.1 in my case),
MySQL Server Port,
username.
2) Now Duplicate this connection and change MySQL Server Port to some dummy not used value.
3) Connect to first connection.
4) Connect to second connection. Even if you used not existent port, it connects successfully to a server from first connection.
You can use "SELECT @@aurora_server_id, @@hostname, @@server_uuid;" to confirm it.

Suggested fix:
It should respect MySQL Server Port.
[4 Dec 2018 9:19] MySQL Verification Team
Thank you for the bug report. Which server version are you trying to connect and which remote OS?. Thanks.
[4 Dec 2018 9:31] Vasiliy Zverev
I am connecting to Aurora db (Amazon MySQL compliant DBMS). SSH host is CentOS release 6.10.
[4 Dec 2018 14:52] MySQL Verification Team
Setup SSH with port 3306

Attachment: 93456_1.png (image/png, text), 150.88 KiB.

[4 Dec 2018 14:53] MySQL Verification Team
SSH Setup with Port 3357

Attachment: 93456_2.png (image/png, text), 145.80 KiB.

[4 Dec 2018 14:55] MySQL Verification Team
Both connections simultaneously showing Port 3306

Attachment: 93456_3.png (image/png, text), 143.01 KiB.

[4 Dec 2018 14:56] MySQL Verification Team
Both connections simultaneously showing Port 3357

Attachment: 93456_4.png (image/png, text), 156.19 KiB.

[4 Dec 2018 14:57] MySQL Verification Team
Thank you for the feedback. I couldn't repeat (please see attached screenshots) against supported servers MySQL and remote OS Ubuntu.