Ich habe drei MySQL Datenbanken auf unterschiedlichen Servern.
Der raspberry kann auf die Datenbank lokal und im LAN zugreifen, nicht aber auf die beim Provider.
Das NAS Laufwerk kann aber ohne Probleme auf die Datenbank im WAN zugreifen.
Evtl. habe ich etwas kaputt-konfiguriert, als ich das WLAN eingerichtet habe.
Ich bin für jede Hilfe dankbar, nach dem ich den ganzen morgen bei google unterwegs war.
Server Beschreibung
192.168.178.61 Raspbery Pi (über WLAN und LAN)
192.168.178.20 NAS von Synology (Linux)
xxx.xxx.xxx.xxx Provider
NAS -> Provider o.k.
NAS -> Raspberry o.k.
Raspberry -> localhost o.k.
Raspberry -> NAS o.k.
Raspberry -> Provider FEHLER: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)
NAS -> Provider:
Pandora> /usr/syno/mysql/bin/mysqladmin -umysqluser -p -h xxx.xxx.xxx.xxx ping
Enter password:
mysqld is alive
Raspberry -> NAS:
pi@raspberrypi ~/avrio $ mysqladmin -umysqluser -p -h 192.168.178.20 ping
Enter password:
mysqld is alive
Raspberry -> Provider:
pi@raspberrypi ~/avrio $ mysqladmin -umysqluser -p -h xxx.xxx.xxx.xxx ping
Enter password:
mysqladmin: connect to server at 'xxx.xxx.xxx.xxx' failed
error: 'Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)'
Check that mysqld is running on xxx.xxx.xxx.xxx and that the port is 3306.
You can check this by doing 'telnet xxx.xxx.xxx.xxx 3306'
pi@raspberrypi ~/avrio $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:58:f3:ea
inet addr:192.168.178.60 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8570 errors:0 dropped:1 overruns:0 frame:0
TX packets:2078 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:742223 (724.8 KiB) TX bytes:304446 (297.3 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5830 (5.6 KiB) TX bytes:5830 (5.6 KiB)
wlan0 Link encap:Ethernet HWaddr 80:1f:02:87:60:71
inet addr:192.168.178.61 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20093 errors:0 dropped:23709 overruns:0 frame:0
TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3343134 (3.1 MiB) TX bytes:8698 (8.4 KiB)
pi@raspberrypi ~/avrio $ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritzi 0.0.0.0 UG 0 0 0 eth0
192.168.178.0 * 255.255.255.0 U 0 0 0 eth0
192.168.178.0 * 255.255.255.0 U 0 0 0 wlan0
/etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.178.60
netmask 255.255.255.0
gateway 192.168.178.1
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 192.168.178.61
netmask 255.255.255.0
gateway 192.168.178.1
dns-nameservers 192.168.178.1
/etc/mysql/my.cnf
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address = 127.0.0.1