[Mono-osx] MySQL connector not working on Mac
Christopher Thielen
cthielen at gmail.com
Thu May 12 19:00:04 EDT 2011
Hi all,
I'm sending this to the OS X Mono list because the problem only exhibits itself on my Mac.
I've got a basic MySQL connector test using version 6.3.6 (latest as of today) of the MySql .NET connector:
using System;
using MySql.Data;
namespace MySQLConnectionTest
{
class MainClass
{
public static void Main (string[] args)
{
MySql.Data.MySqlClient.MySqlConnection conn;
string connStr = "Server=localhost;Uid=root;Pwd=;Database=RightsManagement;";
//string connStr = "Database=RightsManagement;Server=127.0.0.1;User Id=root;Password=something;Pooling=false;";
try
{
conn = new MySql.Data.MySqlClient.MySqlConnection();
conn.ConnectionString = connStr;
conn.Open();
Console.WriteLine("Open OK");
conn.Close();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
Console.WriteLine(ex.ToString());
}
}
}
}
Now, using the mysql CLI program, I can connect to localhost just fine as root (the password is actually blank). This demo also works perfectly on my Linux laptop with the same version of Mono/MonoDevelop and MySQL installed.
But on Mono on my Mac, I receive:
MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts.
at MySql.Data.MySqlClient.NativeDriver.Open () [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.Driver.Open () [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection () [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection () [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver () [0x00000] in <filename unknown>:0
Now, I've seen this error all over Google but the results are either old or corrected by silly things like folks not having networking enabled on their MySQL server or having a firewall block the port. That isn't the case here, as far as I can tell.
Anybody seen this before? Anybody using MySQL on their Mac locally and connecting to it via Mono / MySQL .NET connector?
- Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110512/c0a25fa2/attachment.html
More information about the Mono-osx
mailing list