0

I bought a Classic VPS from OVH with a cPanel 11.36 Installed in it, And I created a Database. Now I'm trying to connect to that database with a simple c# winform app.

MySqlConnection conn;
string myConnectionString;
myConnectionString = "server=vps158***.ovh.net; port=3306; database=My_Database; uid=user; pwd=xxxxxx;";
try
{
    conn = new MySqlConnection();
    conn.ConnectionString = myConnectionString;
    conn.Open();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
    MessageBox.Show(ex.Message);
}

But I get the following error ?

Unable to connect to any of the specified MySQL hosts.

Ayoub_B
  • 702
  • 7
  • 19
  • possible duplicate of [Unable to connect to ASP.Net Development Server issue](http://stackoverflow.com/questions/990033/unable-to-connect-to-asp-net-development-server-issue) – Mathemats Apr 07 '15 at 23:02
  • This sounds like it's a server-side problem and doesn't allow Remote Access. I would confirm on your CPanel that your MySQL database is allowing outside access. A lot of times, hosted servers will only allow you to manage MySQL data within their CPanel. – SteveK Apr 08 '15 at 00:09

1 Answers1

0

user3343494, I solved this question, accessing the advanced configuration when adding the connection. It seems to be some kind of bug. Fill the fields with the information you have about your remote connection and try to connect. Worked for me.

Gerson C Filho
  • 196
  • 1
  • 11