I am trying to connect to Mysql database through vb.net However I run into the error:
Unable to connect to any of the specified MySQL hosts
Try with this ConnectionString
:
MysqlConn.ConnectionString = "Server=localhost;Database=My_Mysql_Database;Uid=root;Pwd=root;"
The "Can't connect to MySQL server" error usually is the result of not being able to reach the server, e.g. if it is not running or it is on a remote machine but firewalls block access. See also the video I added to the MySQL channel for how to set up connections.
Please check that MySql Service is running by typing "services.msc" in the "run". I hope it will help you!
I have the same problem. But I was a server, in a domain, and now the server is outside the domain.
I try to change the rulesin firewall of the server (where there is MySql server). So go to inbound rules, and search the 2 Mysql rules.
Open them and search th Advanced item. Then check Domain, or/and Private, or/and Public
(for me, Domain was the only cheked option, not good for me because I 'm now outside the domain).
Hope it helps ! Cheers :)