Connection to MySQL version 8.0.41 fails. lazarus / 16-Databases ---------------------------------------------------------------------- iginfo · 2025-03-12 18:58 Connection to MySQL version 8.0.41 on WEB server, fails using native component or Zeos due to difficulty with dll. Any help to find or configure them? ---------------------------------------------------------------------- marcov · 2025-03-12 21:26 Can you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect. ---------------------------------------------------------------------- Zvoni · 2025-03-13 07:32 Quote from: marcov on March 12, 2025, 10:26:51 pmCan you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect. ....and it doesn't matter if it's a Web-Sever or not... what matters is, 1) where that server is, and if you have to go through a Router/Firewall or if it's on a local LAN 2) Is the Server configured correctly? As in: Is the mysqld-daemon listening on the correct NIC? ---------------------------------------------------------------------- iginfo · 2025-03-13 13:14 Quote from: marcov on March 12, 2025, 10:26:51 pmCan you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect. Yes I can with HeidiSQL, which does it all. ---------------------------------------------------------------------- Zvoni · 2025-03-13 13:16 Quote from: iginfo on March 13, 2025, 02:14:01 pmQuote from: marcov on March 12, 2025, 10:26:51 pmCan you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect. Yes I can with HeidiSQL, which does it all. And my Questions above? ---------------------------------------------------------------------- iginfo · 2025-03-13 13:56 Quote from: Zvoni on March 13, 2025, 02:16:52 pmQuote from: iginfo on March 13, 2025, 02:14:01 pmQuote from: marcov on March 12, 2025, 10:26:51 pmCan you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect. Yes I can with HeidiSQL, which does it all. And my Questions above? HeidiSQL accesses the database remotely from my client machine and everything works. So all configuration and path possibilities are answered. ---------------------------------------------------------------------- Zvoni · 2025-03-13 14:06 Quote from: iginfo on March 13, 2025, 02:56:16 pmQuote from: Zvoni on March 13, 2025, 02:16:52 pmQuote from: iginfo on March 13, 2025, 02:14:01 pmQuote from: marcov on March 12, 2025, 10:26:51 pmCan you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect. Yes I can with HeidiSQL, which does it all. And my Questions above? HeidiSQL accesses the database remotely from my client machine and everything works. So all configuration and path possibilities are answered. And you are definitely using the same Parameters (IP, Port, Credentials, optional SSL etc.)? In HeidiSQL, fire off "SELECT VERSION();" and post it here. btw: Is your Lazarus/FreePascal-Client-Program 32-Bit or 64-Bit? because you need the clientlib in the correct bitness for your target as well in the correct bitness for Lazarus itself (if you want to use design-time connection), nevermind in the correct version ---------------------------------------------------------------------- rvk · 2025-03-13 14:16 Quote from: iginfo on March 13, 2025, 02:14:01 pmYes I can with HeidiSQL, which does it all. HeidiSQL uses it's own local libraries (dll's). So how did you install the MySQL client libraries for Lazarus ?? ---------------------------------------------------------------------- Zvoni · 2025-03-13 14:26 Quote from: rvk on March 13, 2025, 03:16:50 pmQuote from: iginfo on March 13, 2025, 02:14:01 pmYes I can with HeidiSQL, which does it all. HeidiSQL uses it's own local libraries (dll's). So how did you install the MySQL client libraries for Lazarus ?? Ouch! Didn't think of that. Now the only thing missing is TS saying he's using Ubuntu as Dev- Platform, and installed HeidiSQL as a Snap.... ---------------------------------------------------------------------- dseligo · 2025-03-14 10:08 Quote from: iginfo on March 13, 2025, 02:56:16 pmQuote from: Zvoni on March 13, 2025, 02:16:52 pmQuote from: iginfo on March 13, 2025, 02:14:01 pmQuote from: marcov on March 12, 2025, 10:26:51 pmCan you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect. Yes I can with HeidiSQL, which does it all. And my Questions above? HeidiSQL accesses the database remotely from my client machine and everything works. So all configuration and path possibilities are answered. Try to use DLLs from HeidiSQL then (copy them to your project's directory). Mind bitness of dll (if you installed 64-bit HeidiSQL, your program has also to be 64 bit). ---------------------------------------------------------------------- iginfo · 2025-03-15 20:40 HeidiSQL is 64-bit and uses its own dlls locally. I'm not sure if my Lazarus 3.6 is 32 or 64 bits. I think it's 64 bits because the About tab says 32/64 bits. I looked for the dlls on the MySql website, but I'm not sure either. I think the problem could actually be 32/64-bit compatibility. So if someone can point me in the right direction, maybe I can solve it. ---------------------------------------------------------------------- dseligo · 2025-03-16 01:41 Quote from: iginfo on March 15, 2025, 09:40:52 pmHeidiSQL is 64-bit and uses its own dlls locally. I'm not sure if my Lazarus 3.6 is 32 or 64 bits. I think it's 64 bits because the About tab says 32/64 bits. I looked for the dlls on the MySql website, but I'm not sure either. I think the problem could actually be 32/64-bit compatibility. So if someone can point me in the right direction, maybe I can solve it. Is this under Windows? Check if you have in your project options, under 'Config and Target': Target OS = Win64, Target CPU family = x86_64. Then copy DLLs from HeidiSQL to your project's directory. ---------------------------------------------------------------------- paweld · 2025-03-16 05:32 Quote from: dseligoIs this under Windows? Check if you have in your project options, under 'Config and Target': Target OS = Win64, Target CPU family = x86_64. Then copy DLLs from HeidiSQL to your project's directory. By default, these properties are set to “Default” and then you should check the compiler version in Help > About Lazarus. And there, in the last line, it may be, among other things: - i386-win32-win32/win64 -> 32 bit - x86_64-win64-win32/win64 -> 64 bit ---------------------------------------------------------------------- jcmontherock · 2025-03-17 16:05 I got the same problem. Try an older version of libmysql.dll (for ex: 8.0.34). ---------------------------------------------------------------------- iginfo · 2025-03-17 16:28 Quote from: jcmontherock on March 17, 2025, 05:05:20 pmI got the same problem. Try an older version of libmysql.dll (for ex: 8.0.34). From where I can get it? ---------------------------------------------------------------------- iginfo · 2025-03-17 16:29 Quote from: dseligo on March 16, 2025, 02:41:18 amQuote from: iginfo on March 15, 2025, 09:40:52 pmHeidiSQL is 64-bit and uses its own dlls locally. I'm not sure if my Lazarus 3.6 is 32 or 64 bits. I think it's 64 bits because the About tab says 32/64 bits. I looked for the dlls on the MySql website, but I'm not sure either. I think the problem could actually be 32/64-bit compatibility. So if someone can point me in the right direction, maybe I can solve it. Is this under Windows? Check if you have in your project options, under 'Config and Target': Target OS = Win64, Target CPU family = x86_64. Then copy DLLs from HeidiSQL to your project's directory. Ok. I will try. ---------------------------------------------------------------------- iginfo · 2025-03-17 16:31 Quote from: paweld on March 16, 2025, 06:32:04 amQuote from: dseligoIs this under Windows? Check if you have in your project options, under 'Config and Target': Target OS = Win64, Target CPU family = x86_64. Then copy DLLs from HeidiSQL to your project's directory. By default, these properties are set to “Default” and then you should check the compiler version in Help > About Lazarus. And there, in the last line, it may be, among other things: - i386-win32-win32/win64 -> 32 bit - x86_64-win64-win32/win64 -> 64 bit OK. I will try. ---------------------------------------------------------------------- jcmontherock · 2025-03-17 16:39 maybe at: https://downloads.mysql.com/archives/installer/ ---------------------------------------------------------------------- iginfo · 2025-03-17 20:05 Quote from: jcmontherock on March 17, 2025, 05:39:54 pmmaybe at: https://downloads.mysql.com/archives/installer/ From what I understand, the MySQl download link refers to 32-bit dlls. Am I right? ---------------------------------------------------------------------- eldonfsr · 2025-03-18 00:48 I have the same problem what i did i change to use zeodb and the solution was charset select latingi or what yo config your db..... also the problem when build and run 32 bins lazarus and windows you run windows 64  calling load 64 bits dlls is what i figuerout.... ---------------------------------------------------------------------- anse · 2025-03-18 07:09 Quote from: iginfo on March 17, 2025, 09:05:31 pmQuote from: jcmontherock on March 17, 2025, 05:39:54 pmmaybe at: https://downloads.mysql.com/archives/installer/ From what I understand, the MySQl download link refers to 32-bit dlls. Am I right? No, the installer itself is 32bit, but the contained applications and libraries are 64bit only. MySQL only offers 64 bit versions since some years, which makes quite a bit sense. Makes less sense and much confusion to provide installer binaries in 32 bit, however. @iginfo would be good to see an error message you get with the failed connection, so the chance is higher you get some help. ---------------------------------------------------------------------- iginfo · 2025-03-18 19:32 Quote from: anse on March 18, 2025, 08:09:52 amQuote from: iginfo on March 17, 2025, 09:05:31 pmQuote from: jcmontherock on March 17, 2025, 05:39:54 pmmaybe at: https://downloads.mysql.com/archives/installer/ From what I understand, the MySQl download link refers to 32-bit dlls. Am I right? No, the installer itself is 32bit, but the contained applications and libraries are 64bit only. MySQL only offers 64 bit versions since some years, which makes quite a bit sense. Makes less sense and much confusion to provide installer binaries in 32 bit, however. @iginfo would be good to see an error message you get with the failed connection, so the chance is higher you get some help. I was able to access MySQL and I want to share it with everyone. 1) I installed Lazarus 3.8 64 bit. Before I had Lazarus 3.6 32 bit. 2) I downloaded MySQL 8.0 server from the official website. 3) I copied libmysql.dll from the installation folder to my project folder. 4) I uninstalled MySQL 8.0 server. 5) I tested the project with MySQL80Connection1 and it worked accessing a database on the web. 6) I installed ZeosDBO. I used the ZConnection component with the same database in the same project and it worked perfectly. My conclusion is that Lazarus needs to be 64 bit to work with libmysql.dll which is 64 bit. Completing the information, in certain cases it is necessary to have the OpenSSL library with libcrypto-3-x64.dll and libssl-3-x64.dll in the same project directory. Thank you to everyone who participated in this task.