通过CMD命令行打开防火墙端口 Windows 使用netsh命令。 具体如下 netsh advfirewall firewall add rule name="mysql" dir=in protocol=tcp localport=3306 action=allow