MySQL embedded server

If you are developing Gestinux or if you want to join the developers, write your questions and remarks here.
Post Reply
antoineL
Posts: 26
Joined: 22 Jan 2021, 19:40
Location: Comunitat valenciana

MySQL embedded server

Post by antoineL »

Does anyone has instructions to use the mysqld-5 protocol (with the trailing d), which I understand translates to using the MySQL embedded DB server within DLL libMySQLd.dll?

I do not have experience with this setup, and documentation on the web is thin (the best I have read so far is https://docwiki.embarcadero.com/RADStudio...Connect to MySQL Server (FireDAC) but of course it targets Delphi and FireDAC.)

In a first attempt I installed the thing along with Gestinux (Win 32-bit if it matters), but at connecting (after asking for username and password, put root both time but my educated guess is that anything should fly) Gestinux (exactly TFormDatabase) fires back a UnableToConnect warning with additional information: Access violation.

My guess is that MYSQL is unable to figure its parameters, so I looked around, found the "expert" tab (Additional parameters), and I added there some parameters:

Code: Select all

basedir=./
datadir=./data
The syntax (also tried with leading double hyphens, semicolons, no line breaks) is just my guess (hint to Tintinux: please put some reference to the fields of ZeosLib which this is initailizing; perhaps https://sf.net/p/zeoslib/wiki/driver%20parameters/? TIA.)
Result: no joy.

Can someone point out to me some instructions on how to succeed using the embedded server?


Antoine
tintinux
Site Admin
Posts: 173
Joined: 21 Jun 2012, 19:07
Location: Blois (France)
Contact:

Re: MySQL embedded server

Post by tintinux »

Hi

Gestinux is not currently supporting mysql-d protocol (only mysql and postgresql).
I have never used this protocol elsewhere, and I don't know in what it is useful (I someone knows he is welcome).

However ZEOSLib is said to support mysql-d, so with a few changes in Gestinux sources (GDbConnection, GDatabase) it should be easy to add it.
It is a lot of work to test and maintain a protocol, and we have not so much resources on Gestinux.
I have no time available for that, but maybe you can do it yourself...
I'm currently locking and working on the sources named above. Tell me if you want to work on them.

Best regards.
antoineL
Posts: 26
Joined: 22 Jan 2021, 19:40
Location: Comunitat valenciana

Re: MySQL embedded server

Post by antoineL »

Well, I really thought you did use it...
tintinux wrote: 14 Oct 2021, 18:08I have never used this protocol elsewhere, and I don't know in what it is useful
The main point is to be able to use an embedded database. That is, Gestinux when started also starts the database engine it needs; when it exits, it also stops the engine.
Obviously this is a single-user scenario (which happens to be my use-case!)
It had been used for debugging purposes, but that does not seem to be customary.
Also, a lot of people are reporting problem to set it up; it seems to be possible, but it is certainly not easy.
Absent your experience doing it, I am thinking twice about continue trying.
tintinux wrote: 14 Oct 2021, 18:08However ZEOSLib is said to support mysql-d, so with a few changes in Gestinux sources (GDbConnection, GDatabase) it should be easy to add it.
Yeah, it sort of works, but I would not write it is easy. I spotted a so-called Embedded example in Zeos, and made some advances... then I noticed it was not updated for... 13 years! :shock: And the code really is from 2006. By the way, it speaks volume (in a good way) for the fact the underlying ZeosLib code is rock-solid.

Another relevant element is that the embedded server option has been abandoned by both MySQL and MariaDB teams, nowadays it is not even a build option.
tintinux wrote: 14 Oct 2021, 18:08It is a lot of work to test and maintain a protocol, and we have not so much resources on Gestinux.
I have no time available for that, but maybe you can do it yourself...
I'm currently locking and working on the sources named above. Tell me if you want to work on them.
Indeed I am looking at it.
I was looking at an alternate way, which is to add the Firebird protocol/interface in addition to MySQL and PostGresQL. Firebird is quite a bit more lighter than the others, but it seems to have all the requisites (constraints, triggers).
Pros are that this is a much better forward looking solution, and the embedded option comes mostly out of the box.
Cons are
  • The DDL of Firebird, although not much different from PostGresQL, really is different, mostly lacking: no Serial, no Information_Schema, no Drop If Exists (that one is my main road-blocker nowadays, because of the creation order).
  • The wire protocol of Firebird seems not as secure as the others; for example, TLS is not available built-in; on the other hand, compared with MySQL specifically, Firebird, as well as PostGresQL, seems to be quite a bit better programmed, which means less CVEs...
  • Probably others...
What is your opinion?
tintinux
Site Admin
Posts: 173
Joined: 21 Jun 2012, 19:07
Location: Blois (France)
Contact:

Re: MySQL embedded server

Post by tintinux »

Hi

About MySql embedded server, if it has been abandonned, I don't think it is urgent to enable it for Gestinux.
Up to Gestinux 1.5 the option was present, but I didn't tested it myself and, before you, nobody else made any positive or negative feedback about it.
That's why sometime before your post I deleted the option in the future release 1.6, not yet published.

It would be more useful to add FireBird to the supported DBMS protocols.
However it would require some more work and tests, and I am not very motivated, since MariaDb works perfectly and there are other functionnal developments to achieve.

But if you like, you are welcome to do the job, starting on the sources as soon I have finished some changes related to database parameters.
Only the trunk version should be modified and of course it should not have any impact on the existing protocols.
It will need tests with all of them.

Let me know if you are ready for this and I'll grant you the developper status and tell you when I have published my changes.
Meanwhile you can check if you can get the sources through SVN, compile and build.

Also a review of the spanish translation would be very useful since the current one is old and not completed.
Ask if you have any questions !

Best regards
Post Reply