My purpose: I want two bridged Ubuntu VMs (on one mysql server is setup, and on the other apache and php) to be able to talk to each other. Now I've taken all steps related to setting up the apps on each VM and configuring both apache and mysql, also gave VMs static ip addresses and they can ping each other. Now, mysql VM can see a webpage served by the other, while, the apache system can not connect to the VM running mysql server.
Things I've done: I've searched and I've tried these(and still not working):
- I added "bind-address=0.0.0.0" in "my.cnf" and commented out the one with 127.0.0.1
- 3306 port might be closed on mysql VM. so I opened it using ufw(verified using ufw status verbose) but still when doing "telnet ip-address 3306", I get "connection refused".
- disabling ufw (ufw disable), I thought all ports would get opened, but still I can't even telnet to it on 3306 port.
- "sudo ufw app list" did not suggest "mysql", so I added a rule in INI format to applications.d directory for mysql like below:
[mysql] title=MySql description=db management ports=3306/tcp
now after restarting the ufw, when I do
sudo ufw app list it gives this warning:
WARN: Skipping 'mysql': also in /etc/services Available applications: CUPS
My question: why can't I telnet to the mysql server VM(I can't even when I disable ufw)? Is there anything else that might be stumbling connection? I asked this in this forum because it more seems to be something with Ubuntu and ufw and doesn't seem to be a networking problem.
(I'm not knowledgeable in Ubuntu and I'd be grateful if you mention any dumb wrong assumptions I've made in the above steps.)