vagrant-php icon indicating copy to clipboard operation
vagrant-php copied to clipboard

Connect to mySQL

Open othmoz opened this issue 13 years ago • 3 comments

How do you connect to mysql ? you haven't set an ip address nor a port forwarding like apache. Can I overwrite settings in my Vagrantfile ? I tried to do config.vm.network :hostonly, "33.33.33.10" or config.vm.forward_port 3306, 3333 but it doesn't seem to work

othmoz avatar Jun 19 '12 14:06 othmoz

Ok my bad, config.vm.network :hostonly, "33.33.33.10" works, but still can't connect to mysql, which leads me to think that mysqld is only listening to localhost. How can we change that ?

othmoz avatar Jun 19 '12 15:06 othmoz

Did you get remote MySQL connections working?

codecowboy avatar Jul 10 '12 18:07 codecowboy

I connected to MySQL using SSH tunneling instead of port forwarding, but I still needed to change my.conf to allow connections from localhost instead of the NAT IP address. YMMV, of course.

michaek avatar Aug 09 '12 16:08 michaek