Page 1 of 1

ODBC connection to mysql on vbox vm

Posted: 2. May 2011, 16:36
by virgil_machine
I have been unable to set up an ODBC connection to a mysql database running on a virtual machine under vbox.

Version of vbox doesn't seem to matter--in both cases I am currently on 4.0.6, but the problem has persisted since 3.2.

Case 1: windows xp vm cannot connect to mysql on physical machines (ubuntu lucid), but not on a vm on a different vbox host--using ip address for the server (but CAN connnect to lucid physical machines).

Case 2: ubuntu natty vm cannot connect to mysql on a a lucid vm, also using ip for the server, both vms on the same vbox host.

For case 2 I followed these instructions: http://www.howtoforge.com/adding-an-odb ... -on-ubuntu

Is it possible to connect to mysql on a vm? If so, what am I missing?

Re: ODBC connection to mysql on vbox vm

Posted: 2. May 2011, 18:10
by vbox4me2
Added the odbc user to the userbase for connection to its interface? using Bridge mode?

Re: ODBC connection to mysql on vbox vm

Posted: 2. May 2011, 19:44
by virgil_machine
Thanks for the reply.

In both cases the user is added (privileges in phpmyadmin--I assume that's what you mean), and the server is on a bridged connection. The XP machine is on a separate host, not a bridged connection. The natty machine (on the same host as the vm I'm using as a mysql server) also has a bridged connection.

In the natty/lucid setup, I did not add the user--I guess that happened when I set up the connection that doesn't connect?--the host is designated by name rather than ip.

Re: ODBC connection to mysql on vbox vm

Posted: 2. May 2011, 23:04
by vbox4me2
Is the mysql port open and listening? any messages in the mysql logs?

Re: ODBC connection to mysql on vbox vm

Posted: 2. May 2011, 23:27
by virgil_machine
var/log/mysql/error.log is empty (on the lucid/natty setup)

"telnet ip-address 3306" does not respond...mysql documentation says that's what I want. Note that I only have this problem on vms--not on physical hosts..would there be a difference?

Re: ODBC connection to mysql on vbox vm

Posted: 3. May 2011, 11:54
by vbox4me2
If 3306 does not respond its a simple matter ain't it? run a port listener on the VM and see if any service is listening on 3306, either the server is mis-configured or a firewall/host filter is blocking the port from the outside.

Re: ODBC connection to mysql on vbox vm

Posted: 4. May 2011, 04:08
by virgil_machine
Thank you, but I don't see how that explains why I can get to mysql databases on physical machines but not on vms.

When I sudo nmap -T Aggressive -A -v 127.0.0.1 -p 1-65000 on the vm hosting the db, I see port 3306. If I supply the ip (192.162.x.xxx) I do not see it. However, I don't know what to do with that information.