Recent

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

iginfo

  • New Member
  • *
  • Posts: 27
Connection to MySQL version 8.0.41 fails.
« on: March 12, 2025, 07:58:11 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • FPC developer.
Re: Connection to MySQL version 8.0.41 fails.
« Reply #1 on: March 12, 2025, 10:26:51 pm »
Can you access it using some SQL explorer/ management? Maybe it is from where you connect, not with what you connect.

Zvoni

  • Hero Member
  • *****
  • Posts: 2961
Re: Connection to MySQL version 8.0.41 fails.
« Reply #2 on: March 13, 2025, 08:32:08 am »
Can 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?
« Last Edit: March 13, 2025, 08:33:48 am by Zvoni »
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

iginfo

  • New Member
  • *
  • Posts: 27
Re: Connection to MySQL version 8.0.41 fails.
« Reply #3 on: March 13, 2025, 02:14:01 pm »
Can 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

  • Hero Member
  • *****
  • Posts: 2961
Re: Connection to MySQL version 8.0.41 fails.
« Reply #4 on: March 13, 2025, 02:16:52 pm »
Can 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?
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

iginfo

  • New Member
  • *
  • Posts: 27
Re: Connection to MySQL version 8.0.41 fails.
« Reply #5 on: March 13, 2025, 02:56:16 pm »
Can 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

  • Hero Member
  • *****
  • Posts: 2961
Re: Connection to MySQL version 8.0.41 fails.
« Reply #6 on: March 13, 2025, 03:06:41 pm »
Can 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
« Last Edit: March 13, 2025, 03:25:15 pm by Zvoni »
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

rvk

  • Hero Member
  • *****
  • Posts: 6703
Re: Connection to MySQL version 8.0.41 fails.
« Reply #7 on: March 13, 2025, 03:16:50 pm »
Yes 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

  • Hero Member
  • *****
  • Posts: 2961
Re: Connection to MySQL version 8.0.41 fails.
« Reply #8 on: March 13, 2025, 03:26:22 pm »
Yes 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....
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

dseligo

  • Hero Member
  • *****
  • Posts: 1496
Re: Connection to MySQL version 8.0.41 fails.
« Reply #9 on: March 14, 2025, 11:08:46 am »
Can 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

  • New Member
  • *
  • Posts: 27
Re: Connection to MySQL version 8.0.41 fails.
« Reply #10 on: March 15, 2025, 09:40:52 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.

dseligo

  • Hero Member
  • *****
  • Posts: 1496
Re: Connection to MySQL version 8.0.41 fails.
« Reply #11 on: March 16, 2025, 02:41:18 am »
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.

paweld

  • Hero Member
  • *****
  • Posts: 1351
Re: Connection to MySQL version 8.0.41 fails.
« Reply #12 on: March 16, 2025, 06:32:04 am »
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
Best regards / Pozdrawiam
paweld

jcmontherock

  • Sr. Member
  • ****
  • Posts: 290
Re: Connection to MySQL version 8.0.41 fails.
« Reply #13 on: March 17, 2025, 05:05:20 pm »
I got the same problem. Try an older version of libmysql.dll (for ex: 8.0.34).
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 #14 on: March 17, 2025, 05:28:51 pm »
I got the same problem. Try an older version of libmysql.dll (for ex: 8.0.34).

From where I can get it?

 

TinyPortal © 2005-2018