Vagrant port forwarding for Mysql

前端 未结 3 857
渐次进展
渐次进展 2020-12-15 23:34

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

3条回答
  •  别那么骄傲
    2020-12-16 00:31

    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,

提交回复
热议问题