Link to home
Start Free TrialLog in
Avatar of samueldjohnson
samueldjohnsonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How can I connect Workbench to a MySQL database inside an Ubuntu VMWare VM?


Apologies for the novice question, but I'm new to MySQL and Ubuntu, so still feeling my way around!

We've set up an Ubuntu Virtual Machine on a Windows XP PC, and have installed OpenEMR on it, which is an open-source LAMP medical records application.  (The idea is to use this VM as an appliance, containing the back-end.)  I can successfully use a browser to access the application, and thus create/edit/delete records in the MySQL database, but when I try using Workbench to 'remotely' administer MySQL from the Windows XP side, I can't seem to connect...

I really need to be able to remotely administer the database inside this VM, and am also keen to set up an ODBC link to it (yes, please don't hit me, but I want to map some of these tables into SQL Server!).

Very grateful for any help anyone can give me - note that I *don't* have workbench installed *within* the VM, so if there's a solution that avoids me having to do that, even better.

Many thanks, Sam.
Avatar of samueldjohnson
samueldjohnson
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

PS - sorry, should add a few more details.  On the 'Setup new connection' screen, I'm using:
- 'Standard (TCP/IP)' connection method
- the VM's 'VMnet1' IP address as the hostname
- user 'root' with appropriate password (which I'm told is the equivalent of 'administrator' in Windows)
- the default port (3306)
I've left everything blank on the 'Advanced' tab.

The error I'm getting is "Can't get hostname for your address".

Cheers, Sam.
SOLUTION
Avatar of Patrick Tallarico
Patrick Tallarico
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi guys,

Thanks for this advice, but it unfortunately doesn't seem to have worked.  I've done the following:
1. edited etc\mysql\my.cnf to change bind-address from 127.0.0.1 to 0.0.0.0;
2. restarted MySQL service
3. in MySQL: grant all on *.* to 'root'@'%' identified by '[password]'
4. flushed privileges

When I attempt to setup a new connection to hostname: 192.168.44.1 (the ip address of the VMnet1 network adapter) on port 3306, I still get the same error: "Can't get hostname for your address"!!!

Grateful for any help, this is driving me mad!

Cheers, Sam.
Try adding skip-name-resolve to the my.cnf file, it seems there's a bug in mysql 5.5
Hi Tomun,

Sorry, should have noted that I've already also tried that (after reading a couple of online forums), but also didn't work.  I now can't even connect to the application via the VM host's browser, so am wondering if something else is in fact going on...
Is that because you set a new password for mysql's root user? Does the app give an error message?
My bad: I was using the wrong VM IP address!  (It's obviously dynamic, and had shifted.)  As soon as I used the correct one, everything worked like a dream - and now also have easy ODBC access in order to make some configuration changes.

Points shared, but the majority to Tomun, as he gave the necessary detail for a beginner to be able to resolve this issue.

Many thanks!