Forum > Databases
Connecting to MariaDB 10.6 or 10.11
Zvoni:
Found it:
mysqlconn.inc - Line 572 pp
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TConnectionName.DoInternalConnect;var FullVersion: string;begin InitialiseMysql; if not SkipLibraryVersionCheck then begin FullVersion:=strpas(mysql_get_client_info()); // Version string should start with version number: // Note: in case of MariaDB version mismatch: tough luck, we report MySQL // version only. if (pos(MySQLVersion, FullVersion) <> 1) and (pos(MariaDBVersion, FullVersion) <> 1) then Raise EInOutError.CreateFmt(SErrVersionMisMatch,[ClassName,MySQLVersion,FullVersion]); end; inherited DoInternalConnect; ConnectToServer; SelectDatabase;end;
--- Quote ---// Note: in case of MariaDB version mismatch: tough luck, we report MySQL
// version only.
--- End quote ---
Zvoni:
--- Quote from: bruce.button on February 28, 2024, 08:19:43 pm ---Which connector should I use to connect a Lazarus project to a MariaDB database (using MariaDB version 10.6 or 10.11)?
The closest I can see is MySQL 80. Is there still enough compatibility between MariaDB and MySQL in the latest versions for the MySQL connector to work properly with MariaDB? And where would I obtain the correct client library?
--- End quote ---
If with "Client Library" you mean the dll/so --> From MySQL-Homepage? --> https://dev.mysql.com/downloads/c-api/
bruce.button:
Thank you for all the guidance and instructions. Unfortunately I am not able to connect.
I am using the following:
OS: Windows 11
MariaDB 10.6.16 server running on Linux Ubuntu 22.04 accessed via LAN
In Lazarus, I have dropped a TMySQL57Connection object onto the form. Settings are as follows (see screenshot):
Hostname: [ip address of server on LAN]
Port: [Port of MariaDB on server]
Username and password entered
Database name entered
I have copied libmysql.dll to the project folder. It is a dll for version 5.7.41.0 which I obtained from a Wamp server installation. (I was unable to find a dll file on the MySQL website.)
When I try to connect to the server using the Connected property of the TMySQL57Connection object in the Object Inspector I get the error
"Can not load default MySQL library 'libmysql.dll' or 'libmysql.dll'). Check your installation."
I have tried using the MariaDB client library (libmariadb.dll), which I have previous found to work, even with a MySQL database, but it gives the same error.
It doesn't matter whether I tick "SkipLibraryVersionCheck" or not. In both cases I get the same error.
I would be most grateful for guidance on fixing this problem.
Thank you!
cdbc:
Hi
Rename the DLL to 'libmysql.dll'?!?
Regards Benny
bruce.button:
--- Quote from: cdbc on February 29, 2024, 03:31:43 pm ---Rename the DLL to 'libmysql.dll'?!?
--- End quote ---
Hi Benny
I presume you mane that I should rename libmariadb.dll to libmysql.dll. I have tried that, but it does not work, unfortunately.
Navigation
[0] Message Index
[#] Next page
[*] Previous page