Page 1 of 1

Simple question about MySQL embedded application.

Posted: Mon 11 Oct 2010 23:29
by tanghz
Hi ,
I am wondering how I can use the embedded MySQL server in a Delphi application via UniDAC? Do you have a demo for this ? Better give me a step by step guide if possible.
Thanks very much.

Posted: Tue 12 Oct 2010 08:05
by AndreyZ
Hello,

You can look at the MyDACDemo->TechnologySpecific->Embedded demo. This demo demonstrates working with Embedded MySQL Server. If you don't have MyDAC you can download MyDAC Trial version. Also you can read the Using Embedded Server topic in MyDAC Reference Manual.

Posted: Tue 12 Oct 2010 16:26
by tanghz
Hi , I purchased UniDAC. Will you include that embedded part of function in this product? This is a standard feature of MySQL, I presume.

Posted: Wed 13 Oct 2010 08:10
by AndreyZ
UniDACDemo doesn't have the example of working with Embedded MySQL Server. That's why you can look at this example only in MyDACDemo.

You can connect to the Embedded MySQL server with UniDAC in the following way:

Code: Select all

  UniConnection.ProviderName := 'MySQL'; 
  UniConnection.Database := DatabaseName; 
  UniConnection.SpecificOptions.Values['Embedded'] := 'True'; 
  UniConnection.SpecificOptions.Values['EmbeddedParams'] := '--basedir=.'#13#10'--datadir=data';
The --basedir parameter sets the base path for the Embedded MySQL server. All paths are usually used relatively to the base path. The --datadir parameter sets the path to the data directory.

Posted: Wed 13 Oct 2010 10:11
by tanghz
great, this is a special offer.
I will try it and feed back to you.
Very well thought, UniDAC!

Re: Simple question about MySQL embedded application.

Posted: Wed 19 Sep 2012 11:49
by vallemanden
I tryed this but i keep getting error about can't load libmysql.dll, but it is in the same dir where the exe fil is

using firemonkey
mysql 5.5
unidac 4.5.9

"MySQL client library couldn't be loaded. Please place libmysqld.dll file to system folder (included to PATH) or to the folder with executable unit of main program."

Re: Simple question about MySQL embedded application.

Posted: Wed 19 Sep 2012 14:28
by AndreyZ
Please make sure you placed the libmysqld.dll (and not libmysql.dll) library to the directory where the executable file of your application is located. Also, please note that you should use 32-bit libmysqld.dll for 32-bit applications, and 64-bit libmysqld.dll for 64-bit applications.

Re: Simple question about MySQL embedded application.

Posted: Mon 04 Nov 2013 21:04
by FerCastro
Hello Andrey

Actually I am trying to make an embedded connection with Unidac and MySQL. I have the dll file in the same directory but I get the same message: "MySQL client library couldn't be loaded. Please place..."

Is there something I am missing?

Regards

Re: Simple question about MySQL embedded application.

Posted: Tue 05 Nov 2013 09:19
by AndreyZ
Please try using the following code:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  handle: HMODULE;
begin
  handle := LoadLibrary('libmysqld.dll');
  if handle = 0 then
    ShowMessage(SysErrorMessage(GetLastError));
end;
Does this code shows a message? If yes, please specify the exact message.