Connect to a local MySQL server running on Virtualbox
I am on a Windows 7 machine running a Ubuntu Virtualbox as my local web server and database server (MySQL).
I just got a hold of a copy of Komodo which I am running on my Windows machine. I would like to hook it up to my database.
The fields it needs are hostname
, port
, socket
, username
and password
.
I know the username/password but am unsure how to find out what to put for the other fields. The Ubuntu VB has an IP of 192.168.0.25
, which is in my hosts
file as http://sstmag.dev
I hope I have asked this in the right place, I've been searching google but am having trouble finding an answer, any help much appreciated.
Solution 1:
There are a few things to check:
The VirtualBox machine should have access to your network (or vice-versa), namely a Windows application should know how to reach your VM. If you set up networking as NAT in VirtualBox, this won’t work. Try the bridged networking or host-only networking.
If networking in general works, that is, your windows machine can ping the VM (and maybe even access the web server), you should make sure that MySQL exposes itself to the external network - by default, MySQL only listens on 127.0.0.1. Check the
bind-address
statement in/etc/mysql/my.cnf
or a similar configuration file on Ubuntu.Having done that, you should check whether telnet’ing to the IP and port works from your Windows machine. If it does, Komodo should also work, provided that you configured it correctly.