icsharpcode / SharpDevelop

#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
2.09k stars 773 forks source link

Mysql.data error to connect on Debug Mode #570

Open wcervini opened 10 years ago

wcervini commented 10 years ago

i Have an error using Mysql.Data Native library connection Version 6.5.2, SharpDevelop Version 4.4.1 build 9729 and WIndows 7_X64.

On Debug Mode try to open any database, to reproduce this error.

MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. en MySql.Data.MySqlClient.NativeDriver.Open() en MySql.Data.MySqlClient.Driver.Open() en MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) en MySql.Data.MySqlClient.MySqlConnection.Open()

example:

using System;
using MySql.Data.MySqlClient;

namespace error
{
    public class MysqlConnection
    {
        MySqlCommand oCmd;
        MySqlConnection oCon;

        // On Debug Mode produce an error; unable to connnect to the specific databse
        oCon = new MySqlConnection("User Id=root;password=;server=127.0.0.1;port=3306;pooling=False;Allow User Variables=True;Allow Zero Datetime=True;Convert Zero Datetime=True;database=mysql");
    }
}

then try just RUN without debug and the connection do not produce any error.