I'm not too sure with VSCode in this case, check and see if MySQL server is listening on the correct port first (default is 3306)
netstat -an | find "3306"
And look for address:
0.0.0.0:3306
Another possible problem could be to do with user permission and Firewall.
Check with the step above first.