Problems with embedded mysql.

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
guidaenzo
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 21.07.2012, 06:07

Problems with embedded mysql.

Post by guidaenzo »

I have a problem with embedded mysql

MY SETUP
Windows 7 32bit
lazarus 0.9.30.2
zeoslib ZEOSDBO-6.6.6-stable
mysql- 5.5.25a.0
libmysqld.dll copy to windows/system/ folder

1)
At designetime
I added the component zcomponent in the form
set the protocol property on mysqld-5

When I set the connected property to true lazarus crash and close it, without error messages.

2)
At designetime
I added the component zcomponent in the form
set the protocol property on mysqld-5

procedure TForm1.FormCreate(Sender: TObject);
begin
zconnection2.Connected:=true;
end;

Run application.

The build of the project has been completed successfully, but when execute it the application closes immediately.

The problem occurs only with protocol property on mysqld-5.

I hope you can help
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

guidaenzo,

did you set all server arguments?

Like these:
ServerArgument1=--basedir=./
ServerArgument2=--datadir=./data
ServerArgument3=--character-sets-dir=./share/charsets
ServerArgument4=--language=./share/english
ServerArgument5=--skip-innodb
ServerArgument6=--key_buffer_size=32M


Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
guidaenzo
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 21.07.2012, 06:07

Post by guidaenzo »

these are the settings zconnect:

database -> mysql
username -> ''
password -> ''
hostname ->''
properties->
ServerArgument1=--basedir=./
ServerArgument2=--datadir=./data
ServerArgument3=--character-sets-dir=./share/charsets
ServerArgument4=--language=./share/english
ServerArgument5=--skip-innodb
ServerArgument6=--key_buffer_size=32M

in the application folder I copied the Folder share which contains two folder
charset and english.

the problem persists with no error message.

When I set the connected property to true lazarus crash and close it.
guidaenzo
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 21.07.2012, 06:07

Post by guidaenzo »

The problem occurs even if I click on the catalog properties of the object inspector.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

guidaenzo,

Issues i see @designtime:

The embedded driver expects now the share and data directory in the folder (bpl-dir)\data etc. Which means you have to copy these files to the folder where Lazarus expects the compiled packages.

What i don't like is that there is no exception raised. IDE issues? Hmm i don't know.

If you assign the connection fields @runtime it works perfectly, or am i wrong?

Btw. Switch to Zeos7 from SVN then you can upgrade your LCL and FPC. Z7 is FPC stable. Trust me on that.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
guidaenzo
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 21.07.2012, 06:07

Post by guidaenzo »

If you assign the connection fields @runtime not works perfectly.

I try to update lazarus and install version 7 of zeoslib.
guidaenzo
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 21.07.2012, 06:07

Post by guidaenzo »

Then I installed the latest version of lazarus and zeoslib-trunk.
The installation was successful.
But I have the same problem at both designtime it at runtime.
The application quits.
guidaenzo
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 21.07.2012, 06:07

Post by guidaenzo »

The library libmysqld.dll 5.5.25a.0 version is not supported.
I installed version 5 and it works only at runtime.
In Designetime does not work.
Thanks a lot anyway.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

guidaenzo,

i wish i could help you right now. I know the project-manager does run also the embedded tests. So they are working but i can not really say what your issue is.

Another thing do you set CodePage=UTF8?

If 'yes' then you need to copy the UTF8 characters too.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Well, I'm running an old version. So I don't dare saying it works with mysql 5.5 embedded libraries...
Setting this up isn't an easy job unfortunately. Which is why I avoid upgrading my embedded test servers too. Chances are some settings have been changed between mysql versions or they have been removed. Reading the mysql docs on the C API and the Embedded server API may help.
Always keep in mind direcory settings are interpreted relative to the working directory of the running executable.

Mark
Image
User avatar
Pitfiend
Senior Boarder
Senior Boarder
Posts: 68
Joined: 12.12.2009, 07:27

Post by Pitfiend »

I had this problem too, long time ago. My solution was to put the share and data folders in the same folder as the application and the dynamic library. You must set the database parameters accordingly to point to the right paths. In the data folder you must have a mysql folder containing this tables time_zone, time_zone_leap_second, time_zone_name, time_zone_transition and time_zone_transition_type (no need to have data, empty structure works fine, you can copy them from distro pkg, be aware that there are 3 files for each table *.frm, *.myd, *.myi you need all of them), your databases will be there too; in the share folder you must have at least charsets and english folders (I also suggest you to copy them from distro pkg as they are) and any other language you will use. I think that will solve your troubles.
Post Reply