connect to mysql on ubuntu guest?
Posted: 21. Jun 2013, 21:29
I'm in the process of setting up a php development environment. My physical machine is running Windows 7 64 bit. I am running the latest version of Virtual box and have setup a new Ubuntu 64 bit guest machine. On the guest I have setup Apache, PHP and MySQL, all three appear to be running okay, apache is running php code fine and php is talking to mysql okay. This VM is running in "bridged adapter" network mode. I can connect to Apache okay from the host Windows machine. I have a hosts file entry in windows pointing a made up hostname to the correct IP address of the guest. That hostname works in the web browser in windows to talk to apache in ubuntu.
What I cannot currently do is talk to mysql in the guest from the host. When I try to connect (currently using sqlyog community edition) it says "error 2003. can't connect to mysql server at ..address..". (I've tried both by hostname and IP for mysql and neither works).
I've checked and mysql is definitely listening on tcp port 3306 on the guest.
Any thoughts what I might be missing?
ETA: I have added a user with the requisite privileges (@'localhost' and @'%') to mysql, and can use that user to connect locally from the ubuntu command line, and from php, but not from the host machine.
What I cannot currently do is talk to mysql in the guest from the host. When I try to connect (currently using sqlyog community edition) it says "error 2003. can't connect to mysql server at ..address..". (I've tried both by hostname and IP for mysql and neither works).
I've checked and mysql is definitely listening on tcp port 3306 on the guest.
Any thoughts what I might be missing?
ETA: I have added a user with the requisite privileges (@'localhost' and @'%') to mysql, and can use that user to connect locally from the ubuntu command line, and from php, but not from the host machine.