I am making an application that connects to remote mysql database into some cpanel account. I created the database on the cpanel account and defined a username and password for it. I am using MysqlConnector. So far I have written the following code:
using MySql.Data.MySqlClient;
MySqlConnection c = new MySqlConnection("SERVER = 64.191.12.54; DATABASE = alyataco_test4application; User ID = xxxxxxxx; PASSWORD = xxxxxxxx");
c.Open();
but i got error :
MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts.
i also saw Connect to remote MySQL database with Visual C# but didn`t help too
Your connection string seems wrong. Try:
See http://www.connectionstrings.com/mysql for more connection string exemples.