0

I have two virtual machine in VirtualBox with clean installation Ubuntu server.

I need to mysql connect from one to another VM. I allow access from my second VM with ip 192.168.1.80. In first VM in mysql config I write down:

bind-address = 192.168.1.80

I connect from second VM via user = root, therefore I changed host to % in user table in first VM. Then I allowed connect in ufw by different ways:

ufw status

First VM successfully pings from second. When I try to connect:

mysql -h 192.168.1.118 -u root -p

I see:

ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.118' (111)

I open ports, allow connect in mysql config. What else should I do?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Log
  • 433
  • 4
  • 19
  • Wouldn't that be a question for server fault? – JosefScript Mar 08 '18 at 17:49
  • You are trying to connect to MySQL on 192.168.1.118, while you have configured MySQL to only listen on 192.168.1.80... If .118 is hosting MySQL, then you should configure `bind-address=192.168.1.118`, or otherwise you need to connect to 192.168.1.80, not to .118... The value of `bind-address` needs to be an IP address valid for that server, it is not about which clients can connect. – Mark Rotteveel Mar 08 '18 at 17:53
  • Possible duplicate of [Bind Address and Mysql Server](https://stackoverflow.com/questions/3552680/bind-address-and-mysql-server) – Mark Rotteveel Mar 08 '18 at 17:54
  • @Mark Rotteveel If I set ip .118 or 0.0.0.0 or I comment out this line nothing changes. That link doesn't help. – Log Mar 08 '18 at 17:58
  • You need to restart MySQL for the changes to take effect. In any case, if that doesn't work for you, re-ask your question on https://dba.stackexchange.com/ (or maybe https://serverfault.com/). It is off-topic here (it is not a programming question). – Mark Rotteveel Mar 08 '18 at 18:03
  • Of course I restart mysql. Ok, I reask this question on serverfault, thanks. – Log Mar 08 '18 at 18:25

0 Answers0