I have two Raspbery PI 3 which I have installed (almost) identical. The configuration of /etc/mysql/mariadb.conf.d/50-server.cnf is identical for both Raspberrys.
Problem: I can only connect to the mysql database of one of these Raspberrys (using
MySQL Workbench). So I looked for the problem and found a more "low level" problem: even telnet is not working on one of these Raspberrys.
telnet raspberry1 3306
works perfect, while
telnet raspberry2 3306
tells me that a connection cannot be established.
A ping works from my windows pc to both raspberrys.
A local connection to the MySQL server also works on both Raspberrys.
I even tried to disable any firewall on raspberry2 using
sudo /sbin/iptables --flush
When using a port scanner like
sudo nmap -sS -O raspberry1 raspberry2 I see that port 3306 is open on raspberry1 but not on raspberry2.
sudo netstat -ln gives me a slightly different output on both RPi's:
raspberry1: Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN raspberry2: Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
As mentioned above the file
50-server.cnf is identical on both raspberries - especially the line
bind-address = 0.0.0.0 is set in both files.
(I also restarted raspberry2 using
sudo /etc/init.d/mysql restart. I even restarted Raspbian.)
I still have no clue where the Local Address 127.0.0.1 comes from.
Where could be differences in the configuration of the second Raspberry Pi?