- VMware:11.1.0 build-2496824
- Linux:Ubuntu 14.10
- Windows:win 8.1 x64
MySQL版本
- windws: 5.6.24
- Linux: 5.5.43
IP地址
- Windows:192.168.1.102
- Linux: 192.168.1.100
PS: 双方都可以收到对方的ping请求。
当我输入以下命令:
mysql -h 192.168.1.100 -u root_test -p
我确定输入的密码是正确的,但是MySQL服务器返回了“ERROR 1130 (HY000):主机'192.168.1.100'不允许连接到此MySQL服务器”或“ERROR 2003 (HY000):无法连接到'192.168.1.100'上的MySQL服务器(10061)”。
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN -
my.cnf:bind-address = 0.0.0.0
service iptables status
iptables: unrecognized service
select user,host from user;
+------------------+---------------+
| user | host |
+------------------+---------------+
| root | 127.0.0.1 |
| root_test | 192.168.1.102 |
| debian-sys-maint | localhost |
| root | localhost |
+------------------+---------------+
show grants for 'root_test'@'192.168.1.102';
+-------------------------------------------------------------------------------------------------------------------------------+
| Grants for root_test@192.168.1.102 |
+-------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root_test'@'192.168.1.102' IDENTIFIED BY PASSWORD 'MD5-PWD' |
+-------------------------------------------------------------------------------------------------------------------------------+
更新
我最终通过在 Windows 上更改 IPv4 属性中的“自动获取 IP 地址”为“使用以下 IP 地址”来解决了这个问题。
PS:VMware 的网络设置是“桥接(Bridged)”。
非常感谢 @s3v3n 和 @Drew Pierce,你们非常友善和乐于助人。谢谢。
GRANT ALL PRIVILEGES ON * . * TO 'root_test'@'%'; FLUSH PRIVILEGES;
- s3v3n192.168.1.100
ж— жі•иҝһжҺҘпјҢдҪҶжҳҜиҜҘз”ЁжҲ·жҳҜдёә192.168.1.102
еҲӣе»әзҡ„гҖӮ - s3v3n