List:MySQL and .NET« Previous MessageNext Message »
From:Reggie Burnett Date:January 16 2005 3:52pm
Subject:RE: Has shared memory ever worked? (was: Shared memory and ASP.NET web services)
View as plain text  
Shared memory support is still somewhat buggy in the server.  I have seen
sometimes that the server will not accept shared memory connections when
running as a server.  Try this:

Make sure --shared-memory appears right after server-id=1 in your my.ini
file.  Then type this from the command line:

Mysqld-nt --defaults-file=<full path to my.ini> --standalone --console

The server should start up.  Now in a second console window, type

Mysql --protocol=memory -u <user  you want to connect as>

If you connect, verify you are using shared memory by typing "status" and
seeing what is listed as the connection.  

-reggie

> -----Original Message-----
> From: Homam S.A. [mailto:homam_sa@stripped]
> Sent: Thursday, January 13, 2005 11:32 PM
> To: Mike Hillyer; Darren Hill
> Cc: Reggie Burnett; MySQL DotNet Connector
> Subject: Re: Has shared memory ever worked? (was: Shared memory and
> ASP.NET web services)
> 
> Exactly! I want to avoid going through the TCP stack
> of the loopback address (127.0.0.1). Even though this
> up and down marshalling isn't particularly expensive
> for a single packet, in the big picture with tens of
> thousands of requests per minute, they add up.
> 
> It's just wasterful processing that I'd like to avoid,
> and unfortunately I've yet to figure out how to get
> shared memory protocol to work with the .NET
> connector.
> 
> 
> 
> 
> 
> --- Mike Hillyer <mhillyer@stripped> wrote:
> 
> > One word: Speed.
> >
> > Mike
> >
> > Darren Hill wrote:
> > > This will sound silly, but what's the advantage of
> > using shared memory ... Or is that for another list?
> > > -----Original Message-----
> > > From: "Homam S.A." <homam_sa@stripped>
> > > Date: Thu, 13 Jan 2005 17:59:25
> > > To:Reggie Burnett <reggie@stripped>,
> > dotnet@stripped
> > > Subject: RE: Has shared memory ever worked? (was:
> > Shared memory and ASP.NET web services)
> > >
> > > By the way, I also tried added the following line
> > to
> > > my.ini and restarted MySQL, but it didn't work:
> > >
> > > shared-memory-base-name=MySQL
> > >
> > >
> > >
> > >
> > > --- "Homam S.A." <homam_sa@stripped> wrote:
> > >
> > >
> > >>Hi Reggie,
> > >>
> > >>I added "shared memory name=MYSQL", but I'm still
> > >>getting the same error. I also tried "shared
> > memory
> > >>base name=MYSQL" and it complained that the
> > keyword
> > >>isn't supported. So "shared memory name" is the
> > >>correct one. I also tried "MySQL" and "mysql",
> > >>thinking that may be case matters, to no avail. I
> > >>keep
> > >>getting "Failed to open shared memory connection".
> > >>
> > >>Do I have to configure my SQL somehow to listen to
> > >>shared memory for the name "MYSQL"?
> > >>
> > >>Thanks,
> > >>
> > >>Homam
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>--- Reggie Burnett <reggie@stripped> wrote:
> > >>
> > >>
> > >>>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
> > >>
> > >>>
> > >>
> > >>
> > >>
> > >>__________________________________
> > >>Do you Yahoo!?
> > >>All your favorites on one personal page  Try My
> > >>Yahoo!
> > >>http://my.yahoo.com
> > >>
> > >>--
> > >>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!?
> > > Take Yahoo! Mail with you! Get it on your mobile
> > phone.
> > > http://mobile.yahoo.com/maildemo
> > >
> >
> > --
> > Mike Hillyer, Technical Writer
> > MySQL AB, www.mysql.com
> > Office: +1 403-380-6535
> > Mobile: +1 403-330-0870
> >
> > "The Open Source movement has become a major force
> > across the software
> > industry, and MySQL is the world's most popular open
> > source database."
> > --Fortune Magazine
> >
> > --
> > 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!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo

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