Access mysql db on Ubuntu 14.04.3 as VM of Windows Server 2012
I am running Ubuntu 14.04 as a virtual machine (VM) running off of Hyper-V on Windows Server 2012. I have installed MySQL (LAMP) on Ubuntu. My IP addresses are set to 127.0.0.1 for localhost and 127.0.1.1 for the machinename. I also have installed workbench on Windows Server 2012. I would like to have Workbench directly access the MySQL database on the Ubuntu VM on the same machine. How do I do this?
I read on another post that I need to do the following in MySQL: GRANT ALL ON mydb.* TO remoteuser@'%' IDENTIFIED BY 'SomePASSWORD'; But I am unclear on whether I need to change the IP addresses. I think it shouldn't matter, because I am not connecting to the internet. But maybe localhost for Windows is being confused with localhost for Ubuntu....? Do I need a router and set an IP address or can I directly access the VM from the Windows host? Please help. |
Quote:
I wouldn't. Quote:
Code:
GRANT ALL ON mydb.* TO remoteuser@'<windows_box_IP>' IDENTIFIED BY 'SomePASSWORD'; The mysql in the VM should have a non-routable IP attached to it. What kind of network did you give this VM and what virtualization software did you install? |
My IP address for MySQL in the VM is 127.0.0.1 (i.e. the binding-addess in the /etc/mysql/my.cnf)
I created an 'internal' virtual switch in Hyper-V, which runs the VM. But I keep getting a fail to connect. |
Sorry, I don't know Hyper-V stuff.
but... 127.0.0.1 is a non-routable IP for localhost. Every host has one. To reach the machine you'll need to rem out the bind-address in /etc/mysql/my.cnf on the guest VM, then restart mysql-server on the guest. Then connect to the guest machine's assigned IP in one of the following classes: Code:
10.0.0.0/8 then use the 192.x.x.x, or 172.16.x.x or maybe even 10.x.x.x as the "hostname" in the connection properties of mysql workbench for the Guest VM. Sorry, wish I had more. |
What does "rem out the bind-address" mean?
|
When I change the bind-address in my.cnf to 192.168.0.1, mysql does not restart in Ubunut. Any further suggestions?
|
Leave it alone then.
Did you run this on the guest VM > msyql ? Code:
GRANT ALL ON mydb.* TO remoteuser@'<windows_192_IP>' IDENTIFIED BY 'SomePASSWORD'; flush privileges; exit; |
Ok. Got it to work by obtaining an external IP address from the router. But what I want to do is to close the outside world and directly have Windows Server host and the Ubuntu VM talk directly to one another. I know you can do this by creating a internal virtual switch (maybe). I am not getting that part to work. Right now, I am tying to set a static IP address in Ubuntu. I guess my question is how to I set my IP address in Ubuntu?
I am trying: Code:
vi /etc/host |
Still having trouble getting the Internal Virtual Switch to work. I set an TCP/IPv4 address in Network Connects in Windows. I can ping myself. But I cannot ping the static address I gave in the VM. And vice versa.. Neither machine seems to see the network card. However, if I use DHCP to assign the IP in Windows and Linux, then it works. I cannot figure what is out being done properly. Any suggestions?
|
192.168.0.1 is closed to the outside world.
|
All times are GMT -5. The time now is 01:12 AM. |