The MySQL official documentation shows
The error (2003) Can't connect to MySQL server on 'server' (10061)
indicates that the network connection has been refused. You should
check that there is a MySQL server running, that it has network
connections enabled, and that the network port you specified is the
one configured on the server.
You are trying to access to a MySQL server in another machine, with a virtual IP. I will use my IP's so you can understand better.
My host machine has 2 IP:
- the real IP is 192.168.0.53
- the virtual IP is 192.168.10.1
You can see your host machine IP's executing in a Windows machine
ipconfig
and in a Unix machine
ifconfig
You have to login to the Vagrant machine using
vagrant ssh
Then you have to execute
ifconfig
to see the IP's of the virtual machine.
In my Vagrant VM the IP are:
You can see that I have one IP in the host machine (192.168.10.1) and one in the Vagrant VM (192.168.10.10) in the same LAN.
The Vagrant VM IP (192.168.10.10 in my example) is the one you have to use in your MySQL client.