Recent

Author Topic: How to connect to MariaDb 11  (Read 464 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 382
    • Gestinux
How to connect to MariaDb 11
« on: July 15, 2026, 06:43:14 pm »
Hi

I have a new Ubuntu 26.04 LTS server, and it has MariaDb 11.8.6, client 15.2

I have a command line program built with Lazarus 4.2 which connects to MariaDb with the component MySql80 (as I don't know any other way to do without graphic support )

When I run the program on another old computer having Ubuntu 24.04 and a MariaDb client 15.1, I can connect to the new server.

But when I run the program on the server itself (as it is my target), I get :

Can not load default MySQL library ("libmysqlclient.so.21" or "libmysqlclient.so")

The only libraries present on /usr/lib/x86_64-linux-gnu/ are libmysqlclient.so.24.0.10 and libmariadb.so.3

I was used to solve similar issues on other configurations with a symbolic link, so I tried :
Code: Bash  [Select][+][-]
  1. sudo ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.24.0.10  /usr/lib/x86_64-linux-gnu/libmysqlclient.so
or
Code: Bash  [Select][+][-]
  1. sudo ln -s /usr/lib/x86_64-linux-gnu/libmariadb.so.3  /usr/lib/x86_64-linux-gnu/libmysqlclient.so

But I get :
TMySQL80Connection can not work with the installed MySQL client version: Expected (8.0), got (3.4.9).

If I copy libmysqlclient.so.21.2.46 from the old client and make the link to use it, I get :
TMySQL80Connection : Server connect failed.

I would avoid downgrading my MariaDb server, since this is not very prospective.
Yes I could upgrade to Lazarus 4.8 and rebuild the program, but it will require time and should bring other issues, and I don't see any change in SqlDb in the release notes.

What do you think ? Is there any solution ?

Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

paweld

  • Hero Member
  • *****
  • Posts: 1701
Re: How to connect to MariaDb 11
« Reply #1 on: July 15, 2026, 06:51:53 pm »
Set the SkipLibraryVersionCheck property to True for the database connection component
Best regards / Pozdrawiam
paweld

tintinux

  • Sr. Member
  • ****
  • Posts: 382
    • Gestinux
Re: How to connect to MariaDb 11
« Reply #2 on: July 15, 2026, 07:31:35 pm »
When I do that, using the library /usr/lib/x86_64-linux-gnu/libmysqlclient.so.24.0.10 with a symbolic link, I get :

Exception at 00000000004DCE0F: ESQLDatabaseError:
TMySQL80Connection : Server connect failed
.



Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Thaddy

  • Hero Member
  • *****
  • Posts: 19625
  • Glad to be alive.
Re: How to connect to MariaDb 11
« Reply #3 on: July 15, 2026, 07:43:55 pm »
Don't invent symlinks yourself.
A properly installed MariaDb always works.
You need most of:
 apt list mariadb*
Listing... Done
mariadb-backup/noble-updates 1:10.11.14-0ubuntu0.24.04.1 amd64
mariadb-client-core/noble-updates 1:10.11.14-0ubuntu0.24.04.1 amd64
mariadb-client/noble-updates 1:10.11.14-0ubuntu0.24.04.1 amd64
mariadb-common/noble-updates 1:10.11.14-0ubuntu0.24.04.1 all
mariadb-server-10.5/noble-updates 1:10.11.14-0ubuntu0.24.04.1 amd64
mariadb-server-core/noble-updates 1:10.11.14-0ubuntu0.24.04.1 amd64
mariadb-server/noble-updates 1:10.11.14-0ubuntu0.24.04.1 amd64
mariadb-test-data/noble-updates 1:10.11.14-0ubuntu0.24.04.1 all
mariadb-test/noble-updates 1:10.11.14-0ubuntu0.24.04.1 amd64

This is plain Ubuntu. But you can skip the plugins. Same for plain Debian.

(OR AND THAT MAY ALSO BE THE ISSUE: ONE STUPID ENOUGH NOT TO UPDATE OPENSSL!!!.
That is programmer error.)
« Last Edit: July 15, 2026, 08:01:34 pm by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

tintinux

  • Sr. Member
  • ****
  • Posts: 382
    • Gestinux
Re: How to connect to MariaDb 11
« Reply #4 on: July 15, 2026, 08:26:48 pm »
Don't invent symlinks yourself.
I have not invented anything. There is many advices to use them, and it has worked fine for dozen of years

A properly installed MariaDb always works.
Yes, it worked up to Ubuntu 24.04

What is a properly install for you ?
I installed MariaDb as usual, by
Code: Pascal  [Select][+][-]
  1.  apt install mariadb-server

All the libraries you list for 24.04 look present (with a higher version) :

Code: Pascal  [Select][+][-]
  1. mariadb-backup/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  2. mariadb-client-compat/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 all
  3. mariadb-client-core/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed,automatic]
  4. mariadb-client/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed]
  5. mariadb-common/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 all [installed,automatic]
  6. mariadb-plugin-connect-jdbc/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 all
  7. mariadb-plugin-connect/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  8. mariadb-plugin-cracklib-password-check/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  9. mariadb-plugin-gssapi-client/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  10. mariadb-plugin-gssapi-server/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  11. mariadb-plugin-hashicorp-key-management/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  12. mariadb-plugin-mroonga/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  13. mariadb-plugin-oqgraph/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  14. mariadb-plugin-provider-bzip2/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed,automatic]
  15. mariadb-plugin-provider-lz4/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed,automatic]
  16. mariadb-plugin-provider-lzma/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed,automatic]
  17. mariadb-plugin-provider-lzo/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed,automatic]
  18. mariadb-plugin-provider-snappy/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed,automatic]
  19. mariadb-plugin-rocksdb/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  20. mariadb-plugin-s3/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  21. mariadb-plugin-spider/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64
  22. mariadb-server-compat/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 all
  23. mariadb-server-core/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed,automatic]
  24. mariadb-server/resolute-updates,resolute-security,now 1:11.8.6-5ubuntu0.1 amd64 [installed]
  25. mariadb-test-data/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 all
  26. mariadb-test/resolute-updates,resolute-security 1:11.8.6-5ubuntu0.1 amd64

THAT MAY ALSO BE THE ISSUE: ONE STUPID ENOUGH NOT TO UPDATE OPENSSL!!!
The server was created yesterday and updated. What do you mean ?


Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Thaddy

  • Hero Member
  • *****
  • Posts: 19625
  • Glad to be alive.
Re: How to connect to MariaDb 11
« Reply #5 on: July 16, 2026, 07:18:13 am »
It looks proper. My last remark is just because that seems to happen a lot and is often a cause.
Will try to recreate but on my machines, all up tp date, I have no problems with MariaDB
Any "programmer" that knows only one programming language is not a programmer

tintinux

  • Sr. Member
  • ****
  • Posts: 382
    • Gestinux
Re: How to connect to MariaDb 11
« Reply #6 on: July 16, 2026, 05:22:21 pm »
Quote
on my machines, all up tp date, I have no problems with MariaDB
With Ubuntu 26.04 or MariaDb 11 installed (and no other MySql or MariaDb driver) ?
The issue is only when I run a lazarus command line program using SQLDb.TMysql80Connection on such a server.
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Thaddy

  • Hero Member
  • *****
  • Posts: 19625
  • Glad to be alive.
Re: How to connect to MariaDb 11
« Reply #7 on: July 16, 2026, 05:51:17 pm »
I have to specifically test that scenario and I will, but right now I am busy preparing a KOL release and that basically eats all my time for a few days.
(MariaDB is my goto if SQLite is too lightweight)
« Last Edit: July 16, 2026, 05:52:58 pm by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

jcmontherock

  • Sr. Member
  • ****
  • Posts: 363
Re: How to connect to MariaDb 11
« Reply #8 on: July 17, 2026, 06:23:38 pm »
For the connection you need a client and a server. The client are, for windows, libmysql.dll or libmariadb.dll. Actually I 'm using libmysql.dll with mariadb server 10.4. The problem is that Lazarus does not support last versions of clients. Try to connect with old versions of clients for ex: libmysql.dll version 5.6 used in HeidiSQL. 
« Last Edit: July 17, 2026, 10:49:31 pm by jcmontherock »
Windows 11 UTF8-64 - Lazarus 4.8-64 - FPC 3.2.2

 

TinyPortal © 2005-2018