[Mono-dev] I had problem with mysql_connection
Joshua Kugler
joshua.kugler at uaf.edu
Tue Feb 14 12:58:27 EST 2006
On Monday 13 February 2006 20:26, amru rosyada wrote:
> I try to run code from mono-project this the code :
<SNIP>
> string connectionString =
> "Server=localhost;" +
> "Database=APP_DB;" +
> "User ID=amru;" +
> "Password=amru;" +
> "Pooling=false";
> IDbConnection dbcon;
> dbcon = new
> MySqlConnection(connectionString);
> dbcon.Open();
<SNIP>
> ### But I have some problem, this is the problem output that I had run :
>
> Unhandled Exception:System.Net.Socket Exception:The Socket is not connected
> In<0x0008d>System.Net.Socket:Shutdown(SocketShutdown how)
> In<0x00060>MySql.Data.Common.SocketStream:Read(System.Byte[]
> buffer,Int32 offset,Int32 count)
> In<0x00136>System.IO.BufferedStream:Read(System.Byte[] array,Int32
> offset,Int32 count)
> In<0x0002f>System.IO.BufferedStream:ReadByte()
> In<0x00026>MySql.Data.MySqlClient.PacketReader:ReadHeader()
> In<0x00060>MySql.Data.MySqlClient.PacketReader:OpenPacket()
> In<0x0028e>MySql.Data.MySqlClient.NativeDriver:Open()
> In<0x00027>MySql.Data.MySqlClient.Driver:Create(MySql.Data.MySqlClient.MySq
>lConnectionString settings)
> In<0x00078>MySql.Data.MySqlClient.MySqlConnection:Open
I am guessing (based on the fact that you are connecting to localhost) that
the MySQL connector is trying to find the /tmp/mysql.sock
or /var/lib/mysql.sock file. Trying connecting to the host name or use the
IP of the host and see if it produces the same error. I've used the MySQL
Connector in .Net and mono programs, so I know it works great, I've just
never tried it via localhost.
j----- k-----
--
Joshua Kugler PGP Key: http://pgp.mit.edu/
CDE System Administrator ID 0xDB26D7CE
http://distance.uaf.edu/
More information about the Mono-devel-list
mailing list