List:MySQL and .NET« Previous MessageNext Message »
From:Reggie Burnett Date:January 13 2005 10:16pm
Subject:RE: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)
View as plain text  
Homam

There is a bug related to shared memory but it's a little tricky to find.
:-)

The problem you are seeing is another bug that has a workaround.  In 1.0.3,
the connector doesn't default the shared memory name to MYSQL.  To get
shared memory working, you have to give "shared memory name=MYSQL" on the
connect string.

This has been corrected for 1.0.4.  In the future, you will only need to
give this option if you use a non-standard shared memory name.

-reggie

> -----Original Message-----
> From: Homam S.A. [mailto:homam_sa@stripped]
> Sent: Tuesday, January 11, 2005 7:19 PM
> To: dotnet@stripped
> Subject: Has shared memory ever worked? (was: Shared memory and ASP.NET
> web services)
> 
> Thanks John. Of course I'm running on the same
> machine; otherwise "shared memory" doesn't make sense.
> 
> I take what I said in the original post back. The
> shared memory protocol never worked for me. I was
> mistaken. It doesn't work for me whether I'm using
> ASP.NET, a console application, or a windows forms
> application.
> 
> I added the ASPNET account to the local administrators
> group and it didn't work. Then I tried to run a
> console application and it gave me the same error.
> 
> I wonder if the shared memory protocol works with
> anyone, and what kind of connection string they used.
> Here's the connection string I used:
> 
> "server=localhost;user id=myuserid;
> password=mypassword; database=mydb; protocol=memory;"
> 
> It doesn't work whether I disabled or increase the
> default timeout.
> 
> Here's the stack trace:
> 
> Unhandled Exception:
> MySql.Data.MySqlClient.MySqlException: Unable to
> connect to any of the specified MySQL hosts --->
> MySql.Data.MySqlClient.MySqlExc
> eption: Failed to open shared memory connection
>    at
> MySql.Data.MySqlClient.SharedMemoryStream.GetConnectNumber(Int32
> timeOut)
>    at
> MySql.Data.MySqlClient.SharedMemoryStream.Open(Int32
> timeOut)
>    at MySql.Data.MySqlClient.NativeDriver.Open()
>    --- End of inner exception stack trace ---
>    at MySql.Data.MySqlClient.NativeDriver.Open()
>    at
> MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
>    at
> MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
>    at MySql.Data.MySqlClient.MySqlPool.GetConnection()
>    at
> MySql.Data.MySqlClient.MySqlPoolManager.GetConnection(MySqlConnectionStrin
> g
> settings)
>    at MySql.Data.MySqlClient.MySqlConnection.Open()
>    at
> TestMySQLSharedMemroy.SharedMemoryTest.Main(String[]
> args) in c:\testmysqlsharedmemroy\class1.cs:line 30
> 
> Homam
> 
> 
> 
> 
> 
> 
> 
> --- "John L.Utz III" <john@stripped> wrote:
> 
> > Hello;
> >
> > At Tue, 11 Jan 2005 13:21:06 -0800 (PST),
> > Homam S.A. wrote:
> > >
> > > I'm trying to use the shared memory protocol in an
> > > ASP.NET web service, but I'm getting the following
> > > error:
> > >
> > > "Unable to connect to any of the specified MySQL
> > hosts
> > > --> Failed to open shared memory connection"
> >
> > Which host? is it on the same box as the WebService?
> >
> >
> > > If I remove the the "protocol=memory" from the
> > > connection string, it works fine. If I use the
> > same
> > > connection string in a windows forms or a console
> > > application, the shared memory connection works
> > fine.
> > >
> > > So it seems to me it's a security problem with the
> > > ASP.NET account (ASPNET).
> >
> > well, you have a way to test this using runas to
> > execute your console app or
> > your winform app using the ASPNET
> > account....hmmm...except that you would need
> > the *password* for the ASPNET account and i dont
> > know what that is or how to
> > find that out.
> >
> > so, then the fallback would be to create a new local
> > user with the same
> > permission level as the ASPNET account and see if
> > you can use runas to run
> > your console app or winform with that account and
> > get a successfull connection
> >
> > the other thing you could try would be to
> > temporarily escalate the process by
> > using a different account other than ASPNET. here's
> > the msdn:
> >
> >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-
> us/secmod/html/secmod15.asp
> >
> > > Has anybody used the shared memory protocol from
> > > ASP.NET, and if so, what kind of permissions did
> > you
> > > grant to the ASPNET account to get it to work?
> >
> > i have not used this protocol because i dont
> > currently develop with MySQL, i
> > am a SQLServer guy.
> >
> > but ASPNET permissioning is uniformly obnoxious
> > across all db's :-) and this
> >  is the process that i have used with my current c#
> > project to figure out what
> >  is going wrong from a permissons perspective.
> >
> > HTH!
> >
> > johnu
> >
> >
> > > I appreciate your help!
> > >
> > > Homam
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Read only the mail you want - Yahoo! Mail
> > SpamGuard.
> > > http://promotions.yahoo.com/new_mail
> > >
> > > --
> > > MySQL on .NET Mailing List
> > > For list archives: http://lists.mysql.com/dotnet
> > > To unsubscribe:
> > http://lists.mysql.com/dotnet?unsub=1
> > >
> > >
> >
> > --
> > MySQL on .NET Mailing List
> > For list archives: http://lists.mysql.com/dotnet
> > To unsubscribe:
> >
> http://lists.mysql.com/dotnet?unsub=1
> >
> >
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - now with 250MB free storage. Learn more.
> http://info.mail.yahoo.com/mail_250
> 
> --
> MySQL on .NET Mailing List
> For list archives: http://lists.mysql.com/dotnet
> To unsubscribe:    http://lists.mysql.com/dotnet?unsub=1

Thread
Shared memory and ASP.NET web servicesHomam S.A.11 Jan
  • Re: Shared memory and ASP.NET web servicesJohn L . Utz III11 Jan
    • Has shared memory ever worked? (was: Shared memory and ASP.NET web services)Homam S.A.12 Jan
      • Re: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)John L . Utz III12 Jan
      • RE: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)Reggie Burnett13 Jan
        • RE: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)Homam S.A.14 Jan
          • RE: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)Homam S.A.14 Jan
Re: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)Darren Hill14 Jan
  • Re: Has shared memory ever worked? (was: Shared memory and ASP.NETweb services)Mike Hillyer14 Jan
    • Re: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)Homam S.A.14 Jan
      • RE: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)Reggie Burnett16 Jan