I am trying to setup port forwarding in Vagrantfile to connect to guest mysqld from host system, but get reading initial communication packet error.
Host: Yosem
The first answer is right but not enough.when I connect MySQL, I get a error:
Host '10.0.2.2' is not allowed to connect to this MySQL server
Solution:
create user 'root'@'10.0.2.2' identified by 'password';
grant all privileges on . to 'root'@'10.0.2.2' with grant option;
flush privileges;
aha, all problems are solved,