我试图通过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;
错误屏幕打印
我在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一样。但它似乎也没有得到回答。请帮忙。
更新
当我关闭计算机的防火墙时,它可以正常工作。