Recent

Author Topic: TMySQL56Connection can not work with the installed MySQL client version  (Read 2136 times)

Mario

  • New Member
  • *
  • Posts: 28
Hi!

I'm trying to use TSQLConnector, and this is the error message I get:

TMySQL56Connection can not work with the installed MySQL client version: Expected (5.6), got (3.3.8).

I am on a current Debian 12, with fpc and lazarus (and mysql, etc) installed with apt. I found this bug report:

https://gitlab.com/freepascal.org/fpc/source/-/issues/39422

It says I should set SkipLibraryVersionCheck to false, but alas, the compiler says that this property doesn't exist. Here's the listing:

Code: Pascal  [Select][+][-]
  1.    Conn := TSQLConnector.Create(nil);
  2.    with Conn do begin
  3.      SkipLibraryVersionCheck := True;  { Alas, not found. }
  4.       ConnectorType := 'mysql 5.6';
  5.       HostName := 'localhost/';
  6.       DatabaseName := 'vmail';
  7.       UserName := 'vmail';
  8.       Password := '*********';
  9.       Transaction := TSQLTransaction.Create(Conn);
  10.    end;
  11.  

How can I solve this? Thanks!
« Last Edit: June 16, 2024, 10:00:38 am by Mario »

CharlyTango

  • Jr. Member
  • **
  • Posts: 65
for some (unknown by me) reason the TSQLConnector does not have a "SkipLibraryVersionCheck" property.
This property exists only in the database specific connectors like TMySQL56Connection.

If you need more flexibility i recommend ZEOS
Lazarus stable, Win32/64

Thaddy

  • Hero Member
  • *****
  • Posts: 15229
  • Censorship about opinions does not belong here.
The component is simply right to refuse if it is a MySQL 3.3 that is installed and that is very old.. Try the component for MySQL40. But it is usually better to install MariaDb (compatible) since Debian decided to drop direct support for MySQL after Oracle took over and subsequentially tinkered with the original license,,,,,MariaDB can be used as a drop in replacement for higher MySQL versions and is written by the original developers of MySQL. And Debian is not the only major distribution to drop MySQL support....
The reason is one of the most famous FOSS quarrels to date. Most distributions, like Debian, therefor provide a version of MySQL that still adheres to their philosophy regarding open source software.

What makes you think that a component for 56 works with a version 33? I wonder what kind of coffee you had...
https://developers.slashdot.org/story/06/12/13/1515217/mysql-quietly-drops-support-for-debian-linux-updated
https://linuxgenie.net/how-to-install-mysql-on-debian-12-bookworm/
AND:
https://stackoverflow.com/questions/67865527/debian10-unable-to-start-mysql-server

Only red hat enterprise and suse enterprise support MySQL officially. So only the enterprise versions of these two. All other nixes are stuck with older distributions or unofficial packages.
IOW Oracle screwed it up and you were sleepingi if you did not know that.

The FOSS quarrel went both ways: Oracle finally reacted and changed the server license even more restricted since October.  If Possible, use MariaDB. It is just as good, faster and API compatible.
And if the versioncheck is unknown, you also have an old Lazarus.
« Last Edit: June 16, 2024, 01:12:19 am by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

Thaddy

  • Hero Member
  • *****
  • Posts: 15229
  • Censorship about opinions does not belong here.
Actually, by now, it is time to rename/clone the components to MariaDB versions and move on.
The MySQL components 56 or higher work perfectly well with MariaDB. It is not 2006-9 anymore.
MariaDB was forked from 3.3...

Ever since they have a rat race with features and compatibility just like FreePascal/Lazarus and Delphi. Although that is mostly amicably.

https://en.wikipedia.org/wiki/MariaDB
« Last Edit: June 16, 2024, 01:34:01 am by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

GordonFindlay

  • New Member
  • *
  • Posts: 19
CharlyTango has given you the answer - use database specific connectors and then set SkipLibraryVersionCheck.

But for completeness - you seem to be running mariadb, not MySQL. mariadb uses MySQL terminology in many places-- for example the connector, configuration files (my.cnf ..), command-line utilities (mysqladmin, mysqlbackup ...) but returns its own version numbers, which are not reflected in the fpc connector code.

Previously discussed in the thread https://forum.lazarus.freepascal.org/index.php/topic,66948.0.html among others.

Thaddy

  • Hero Member
  • *****
  • Posts: 15229
  • Censorship about opinions does not belong here.
Nonsense, Gordon
MariaDB never had a version 3.3. the oldest release was 5.1 and in sync with mySql 5.1.
3.3 is mysql and old
See tthe release history;
https://mariadb.com/kb/en/mariadb-releases/
Lazarus is also old if the mysql connectors do not have skipversioncheck.
Yor best place to start is with one of the older mysql connectors and a newer lazarus.
The Lazarus components themselvesmake no use of MariaDB specific features and MariaDB was upto version 11 almost 100% in sync with MySQL  behavior and formats.
Main differences are the newer storage engines, but these are opaque to the Lazarus controls.They care only about the SQL dialects and these are compatible.

The true version can be revealed by typing mysql -V
same command worked also for mariadb, but is now changed to mariadb -V for versions beyong 10.
« Last Edit: June 16, 2024, 09:59:10 am by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

Mario

  • New Member
  • *
  • Posts: 28
Hi,

thanks for the answers!

AFAICT, mysql 3.3 is not installed on this system, unless something really really strange happened.

mysql --version returns

Code: Pascal  [Select][+][-]
  1. mysql  Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper

So basically I have no idea what is going on. But I'll try with the version specific TMySQL connector later.

Regards,
           Mario

MarkMLl

  • Hero Member
  • *****
  • Posts: 7126
AFAICT, mysql 3.3 is not installed on this system, unless something really really strange happened.

But something's pulled in an old client library. Try to track it down (i.e. probably a .so file) and then use apt-file to determine what package it's come from (which would probably merit a Debian bug report).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

CharlyTango

  • Jr. Member
  • **
  • Posts: 65
Since mariadb is currently neglected in SQLDB, I recommend:

  • Update to Lazarus 3.4
  • ZEOS as access components (latest version 8.0 is available in the Online Package Manager OPM)
  • As an access library, download the corresponding DLL (or the comparable Linux .so component) directly from MariaDB.org.

I use the same combination.
Lazarus stable, Win32/64

Thaddy

  • Hero Member
  • *****
  • Posts: 15229
  • Censorship about opinions does not belong here.
That looks like a valid version. Try to use MySQL80 as connection.
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

Mario

  • New Member
  • *
  • Posts: 28
AFAICT, mysql 3.3 is not installed on this system, unless something really really strange happened.

But something's pulled in an old client library. Try to track it down (i.e. probably a .so file) and then use apt-file to determine what package it's come from (which would probably merit a Debian bug report).

MarkMLl

Hmm... I found a few things with "3.3" in the file name, but none mysql-related. I was hoping to find the .so but nope.

Thaddy

  • Hero Member
  • *****
  • Posts: 15229
  • Censorship about opinions does not belong here.
With my installation a plain mysql.so an on windows a plain mysql.dll show up.
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

Mario

  • New Member
  • *
  • Posts: 28
AFAICT, mysql 3.3 is not installed on this system, unless something really really strange happened.
But something's pulled in an old client library. Try to track it down (i.e. probably a .so file) and then use apt-file to determine what package it's come from (which would probably merit a Debian bug report).

Turns out it's libmariadb3. It is installed by libmariadb-dev-compat, which just creates a symbolic link for libmysqlclient.so -> libmariadb3.so. Which indeed has version 3.3.8, which in turn seems to be the correct and current mariadb client library version. Checked by outputting mysql_get_client_info() in a C program (see below). I think this is a bug because it's not the corresponding mysql client version.

Does someone know if the upstream libariadb3 has this problem too?

Code: C  [Select][+][-]
  1. #include <stdio.h>
  2. #include <mysql/mysql.h>
  3.  
  4. void main (int argc, char* argv[])
  5. {
  6.    printf("%s\n", mysql_get_client_info());
  7. }

Seenkao

  • Hero Member
  • *****
  • Posts: 568
    • New ZenGL.
Эта проблема как-то решается?
Я весь интернет перерыл, из-за этой проблемы. Использование MariaDB в Lazarus вызывает проблемы с подключением как в первопосте.
Терминал же выводит:
Quote
mysql --version
mysql  Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper

----------------------------------------------------
Google translate:
Is this problem somehow solved?
I scoured the entire Internet because of this problem. Using MariaDB in Lazarus causes connection problems as in the first post.
The terminal outputs:
Quote
mysql --version
mysql  Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Zvoni

  • Hero Member
  • *****
  • Posts: 2485
TSQLConnector has a protected Read-only Property "Proxy" which represents the "real" TSQLConnection

Maybe derive your own TSQLConnector-Class changing that Property to Public and read/write.

I think to remember there was something similar some years ago here on this Forum

Everything said: MariaDB 10.11 (See TS version-output) is from 2022....
So MySQL80 would be the correct one, not 5.6
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018