I have got a same question like you, I use wireshark to capture my sent TCP packets, I found when I use mysql
bin to connect the remote host, it connects remote's 3307 port, that's my falut in /etc/mysql/my.cnf
, 3307 is another project mysql port, but I change that config in my.cnf
[client] part, when I use -P
option to specify 3306 port, it's OK.