从win7连接到VirtualBox / CentOS / MySQL


0

我在Win7中运行VirtualBox 4.2.16。我在CentOS 6.4中有MySQL服务器。从Win7到CentOS的Telnet都没问题。

mysql -u root -h 192.168.56.102 p 在CentOS很好。

这是我在用户表中的内容:

mysql> select user, host from user;
+------+----------------+
| user | host           |
+------+----------------+
| mm   | 127.0.0.1      |
| root | 127.0.0.1      |
| mm   | 192.168.56.102 |
| root | 192.168.56.102 |
| mm   | localhost      |
| root | localhost      |
+------+----------------+

6 rows in set (0.00 sec)

MySQL status:

mysql  Ver 14.14 Distrib 5.6.13, for Linux (x86_64) using  EditLine wrapper

Connection id:      14
Current database:   
Current user:       root@loc
SSL:            Not in use
...
Connection:     192.168.56.102 via TCP/IP

/usr/my.cnf:

[mysqld]

log_bin
port = 3306
bind-address = 192.168.56.102

/etc/hosts:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.102 loc

不过,当我尝试从Win7 / HeidiSQL连接到192.168.56.102端口3306上的root时,我得到了

SQL错误(1130)...主机'192.168.56.1'不允许连接到此MySQL服务器。

CentOS防火墙已关闭,但据我所知,这不是防火墙的问题......有什么想法吗?

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.