I was looking on many posts about this problem but not found an answer.

I try to connect to mysql DB that exist on some server, I use with the following code from <https://www.connectionstrings.com/sql-server-2014/> and <https://www.codeproject.com/Articles/43438/Connect-C-to-MySQL>

```
private string server = "xx.xxx.xxx.xx";
private string database = "testDB";
private string username = user;
private string password = password;
string connectionString;
connectionString = string.Format("Server={0},3306; Database=
{1}; User Id={2}; password={3};", server, database, username, 
password);

connection = new MySqlConnection(connectionString);
try
{
    connection.Open();
}
catch (MySqlException ex)
{
   return false;
}      

```

I install MySql.Data.dll from nuget console and open the port 3306(tcp) in the server.

When I try to open connection it gives me an error "Unable to connect to any of the specified MySQL hosts".

Someone has an idea why?

Thanks