title: Connection to mysql database does not work c #
body: <p>I'm trying to connect to my mysql database (I'm hosted by infinityfree.net), entering these credentials:</p>
  <pre><code>connection = new MySqlConnection(&quot;Server=sql306.epizy.com; Port=3306; Database=epiz_27674946_db1; Uid=epiz_27674946; Pwd=**********; &quot;);
  </code></pre>
  <p>But I get this exception:</p>
  <pre><code>Unable to connect to any of the specified mysql hosts
  </code></pre>
  <p>I don't know why this happens, the credentials should be right...</p>
  <p>Can you help me?</p>
  <p>Full code:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using MySql.Data.MySqlClient;
  
  namespace sharetru
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          MySqlConnection connection;
  
          private void Form1_Load(object sender, EventArgs e)
          {
              try
              {
                  connection = new MySqlConnection(&quot;Server=sql306.epizy.com; Port=3306; Database=epiz_27674946_db1; Uid=epiz_27674946; Pwd=*******; &quot;);
                  connection.Open();
                  if (connection.State == ConnectionState.Open)
                  {
                      label1.Text = &quot;Connected&quot;;
                      label1.ForeColor = Color.Green;
                  }
                  else
                  {
                      label1.Text = &quot;Not Connected&quot;;
                      label1.ForeColor = Color.Red;
                  }
              }
              catch (Exception ex)
              {
                  MessageBox.Show(ex.Message);
              }
          }
      }
      }
  </code></pre>