How to connect to a non-default shared memory base name?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
skirsche
Posts: 8
Joined: Fri 03 Apr 2009 06:59

How to connect to a non-default shared memory base name?

Post by skirsche » Thu 01 Jul 2010 10:03

If I start the mysqld-nt.exe with these command line options:

Code: Select all

--skip-networking --shared-memory --shared-memory-base-name=MYSQL
this code will successfully connect to it:

Code: Select all

MyConnection.Options.Direct := False;
MyConnection.Options.Protocol := mpMemory;
MyConnection.Connect;
Now I have to set a different value for --shared-memory-base-name=. How do I tell a TMyConnection to connect to this instance?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 01 Jul 2010 13:55

Now MyDAC does not provide such functionality, but we will support it in the next build.

skirsche
Posts: 8
Joined: Fri 03 Apr 2009 06:59

Post by skirsche » Fri 02 Jul 2010 07:01

Thanks!

skirsche
Posts: 8
Joined: Fri 03 Apr 2009 06:59

Post by skirsche » Tue 07 Dec 2010 08:56

The History.html of Version 5.90.0.60 says "Added ability to set shared-memory-base-name for the mpMemory protocol", but I can't figure out how to use it.

Which property do I have to modify to set the shared-memory-base-name?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 07 Dec 2010 14:04

To set shared-memory-base-name you should specify it in the TMyConnection.Server property separated by a comma, like this:

Code: Select all

  MyConnection.Server := 'server,shared_memory_base_name';

skirsche
Posts: 8
Joined: Fri 03 Apr 2009 06:59

Unicode-MyDAC

Post by skirsche » Mon 23 May 2011 09:34

Setting the shared-memory-base-name like this:

Code: Select all

MyConnection.Server := 'localhost,MYSQL';
works fine with Delphi 7, but raises EMyError 'Can't open shared memory; client could not request event (2)' on Delphi 2010. Both MyDAC 5.90.0.60 and 6.10.0.7 behave the same.

I can connect to the default instance from Delphi 2010 by leaving MyConnection.Server empty.

Do I have to use a different TMyConnection.Server value for Unicode-MyDAC?

AndreyZ

Post by AndreyZ » Thu 26 May 2011 06:40

Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next MyDAC build.

Post Reply