我有一個數據庫保存在主服務器上。我想從工作人員連接到數據庫。mysql連接到遠程數據庫
這裏是我做了主:
[email protected]:~$ mysql -u root
mysql> GRANT ALL ON ChemAlive_DB.* TO [email protected] ;
而且在worker1:
[email protected]:~$mysql -u root -h xx.xx.xxx.xxx
我也試過:
bomble @ worker1:〜$ mysql的-u bomble - h xx.xx.xxx.xxx
在這兩種情況下,我得到:
ERROR 2003(HY000):無法連接到MySQL服務器 'xx.xx.xxx.xxx' (110)
平是工作,但不能telnet:
[email protected]:~$ ping xx.xx.xxx.xxx
PING xx.xx.xxx.xxx (xx.xx.xxx.xxx) 56(84) bytes of data.
64 bytes from 10.0.0.254: icmp_seq=1 ttl=64 time=1.04 ms
64 bytes from 10.0.0.254: icmp_seq=2 ttl=64 time=0.939 ms
64 bytes from 10.0.0.254: icmp_seq=3 ttl=64 time=0.887 ms
--- xx.xx.xxx.xxx ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.887/0.956/1.044/0.074 ms
[email protected]:~$ telnet xx.xx.xxx.xxx
Trying xx.xx.xxx.xxx...
telnet: Unable to connect to remote host: Connection refused
我應該如何繼續?
它看起來像兩個機器(防火牆)上打開的端口mysql是不是打開 檢查[mysql參考](http: //dev.mysql.com/doc/refman/5.7/en/connecting.html)和[本文](http://serverfault.com/questions/260239/unable-to-connect-to-mysql-through-端口3306) – Rik
我同意,但我不明白如何打開它們 – Laetis
你正在運行的Windows或Linux? – Rik