I got mysql database in the phpmyadmin, and i try to connect to the database from my application.
My connection string is:
Server=12.919.18.12;Port=3306;Database=hbd;Uid=hb;Pwd=123;
An exception occurs:
"Unable to connect to any of the specified MySQL hosts."
Do I need to install mysql or something?
(I just imported MySql.Data.dll and tryied it. Is there anything I have forgotten? I checked the ip pinging my website).
You may check mysql server is working or not and you can add port number of mysql in connection string like this
Other reason MySql might be configured to listen to only the local host.
Follow the following links for more information:
Enabling MySQL Remote Access – MySQL connection only works from local machine
Unable to connect to any of the specified MySQL hosts.