Recent

Author Topic: Connection to MySQL version 8.0.41 fails.  (Read 1618 times)

iginfo

  • New Member
  • *
  • Posts: 27
Re: Connection to MySQL version 8.0.41 fails.
« Reply #15 on: March 17, 2025, 05:29:51 pm »
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.

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

  • New Member
  • *
  • Posts: 27
Re: Connection to MySQL version 8.0.41 fails.
« Reply #16 on: March 17, 2025, 05:31:56 pm »
Quote from: dseligo
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.
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

  • Sr. Member
  • ****
  • Posts: 290
Windows 11 UTF8-64 - Lazarus 4.0RC2-64 - FPC 3.2.2

iginfo

  • New Member
  • *
  • Posts: 27
Re: Connection to MySQL version 8.0.41 fails.
« Reply #18 on: March 17, 2025, 09:05:31 pm »
maybe at: https://downloads.mysql.com/archives/installer/


From what I understand, the MySQl download link refers to 32-bit dlls. Am I right?

eldonfsr

  • Hero Member
  • *****
  • Posts: 543
Re: Connection to MySQL version 8.0.41 fails.
« Reply #19 on: March 18, 2025, 01:48:10 am »
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

  • New Member
  • *
  • Posts: 10
Re: Connection to MySQL version 8.0.41 fails.
« Reply #20 on: March 18, 2025, 08:09:52 am »
maybe 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

  • New Member
  • *
  • Posts: 27
Re: Connection to MySQL version 8.0.41 fails.
« Reply #21 on: March 18, 2025, 08:32:32 pm »
maybe 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.
« Last Edit: March 18, 2025, 09:18:38 pm by iginfo »

 

TinyPortal © 2005-2018