Simple question about MySQL embedded application.

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tanghz
Posts: 23
Joined: Wed 17 Jan 2007 02:40

Simple question about MySQL embedded application.

Post by tanghz » Mon 11 Oct 2010 23:29

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.

AndreyZ

Post by AndreyZ » Tue 12 Oct 2010 08:05

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.

tanghz
Posts: 23
Joined: Wed 17 Jan 2007 02:40

Post by tanghz » Tue 12 Oct 2010 16:26

Hi , I purchased UniDAC. Will you include that embedded part of function in this product? This is a standard feature of MySQL, I presume.

AndreyZ

Post by AndreyZ » Wed 13 Oct 2010 08:10

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.
Last edited by AndreyZ on Wed 13 Oct 2010 11:07, edited 1 time in total.

tanghz
Posts: 23
Joined: Wed 17 Jan 2007 02:40

Post by tanghz » Wed 13 Oct 2010 10:11

great, this is a special offer.
I will try it and feed back to you.
Very well thought, UniDAC!

vallemanden
Posts: 19
Joined: Sat 11 Jun 2011 07:44

Re: Simple question about MySQL embedded application.

Post by vallemanden » Wed 19 Sep 2012 11:49

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."

AndreyZ

Re: Simple question about MySQL embedded application.

Post by AndreyZ » Wed 19 Sep 2012 14:28

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.

FerCastro
Posts: 47
Joined: Mon 26 Jun 2006 17:32
Location: México City
Contact:

Re: Simple question about MySQL embedded application.

Post by FerCastro » Mon 04 Nov 2013 21:04

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

AndreyZ

Re: Simple question about MySQL embedded application.

Post by AndreyZ » Tue 05 Nov 2013 09:19

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.

Post Reply