无法连接到任何指定的MySQL主机vb.net

时间:2017-05-31 07:38:48

标签: mysql vb.net

我试图通过vb应用程序连接到mysql数据库。当我将服务器用作localhost时,它会连接。但是,当我使用IP地址 - 192.168.1.112时,它会给出错误 - Unable to connect to any of the specified MySQL hosts

工作连接字符串

server=localhost; database=gm; userid=root; password=root;

不能正常工作的连接字符串

server=192.168.1.112; database=gm; userid=root; password=root;

错误屏幕打印 enter image description here 我在mysql中运行了以下查询以授予所有权限 -

grant all privileges on gm.* to 'root'@'192.168.1.112' identified by 'root'; 
flush privileges;

但仍然没有把它连接起来。这几乎和 - Connect to remote MySQL database using VB.NET 2010一样。但它似乎也没有得到回答。请帮忙。

更新

当我关闭计算机的防火墙时,它可以正常工作。

0 个答案:

没有答案