[Mono-bugs] [Bug 692293] New: Cannot connect to the specify host, MySQL

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri May 6 10:48:15 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=692293

https://bugzilla.novell.com/show_bug.cgi?id=692293#c0


           Summary: Cannot connect to the specify host, MySQL
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.10.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: interop
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: i.danns.manrique at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: DeveloperNet
           Blocker: Yes


Description of Problem:


Steps to reproduce the problem:
1. Create a web service that connects to a MySQL Server (Use the MySQL
Connector for ADO.NET, Mysql.Data.dll)
2. Try to insert data to any database like this:

using System;
using System.Web;
using System.Web.Services;
using MySql.Data.MySqlClient;

namespace pruebaWSMySQL
{


    public class Service : System.Web.Services.WebService
    {
        [WebMethod]
        public bool insertdata (int i , string user){
            try {
                MySqlConnection connection = new
MySqlConnection("server=localhost; database=somedata; user=root;
password=1234");
                                 MySqlCommand command= new MySqlCommand("Insert
into data (id, user) values('" + id.ToString() + "','" + user + "')",
connection);
                connection.Open();
                connection.Close();
            return true;

            } catch (Exception ex) {
                return false;
            }

        }
    }
}


Actual Results:
                When debugging the web server it stops when trying to connect
the database (Connection.Open) send me to the catch code and says: Could not
connect to any of the specify host.

I verify already the database server and all this is running smoothly, also I
tried this on 2 different Mac and it happened just the same.


Expected Results:
       Connect to the database and insert the data, then return a true value,
it something goes wrong then return a false value.

How often does this happen? 
       It happens just when I upgrade my Mono framework from 2.10.1 to 2.10.2,
it means that using 2.10.1 Mono Framework this code runs perfectly

Additional Information:
        The code is for demonstration purposes only

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list