Recent

Author Topic: Can't connect MySQL (cannot load library libmysql.dll)  (Read 360 times)

kaedusoft

  • New Member
  • *
  • Posts: 10
Can't connect MySQL (cannot load library libmysql.dll)
« on: September 15, 2022, 03:24:55 pm »
I am trying to connect my Lazarus application to MySQL. I have tried everything but it doesn't work. Could someone tell me how to do it step by step? I am working on Windows 10. Thank you very much.

dseligo

  • Hero Member
  • *****
  • Posts: 813
Re: Can't connect MySQL (cannot load library libmysql.dll)
« Reply #1 on: September 15, 2022, 03:57:44 pm »
If you get this error you probably have database components set.

Try this:
1. Put libmysql.dll in your program's directory.
2. Make sure that bitness of your program matches bitness of libmysql.dll (i.e. if your program is 64 bit, libmysql.dll also has to be 64 bit)

Zvoni

  • Hero Member
  • *****
  • Posts: 1523
Re: Can't connect MySQL (cannot load library libmysql.dll)
« Reply #2 on: September 15, 2022, 04:03:43 pm »
If you get this error you probably have database components set.

Try this:
1. Put libmysql.dll in your program's directory.
2. Make sure that bitness of your program matches bitness of libmysql.dll (i.e. if your program is 64 bit, libmysql.dll also has to be 64 bit)
That is if he's actually saved the Project there.
If he just fired up Lazarus, and entered some testcode, the dll in that place won't help him, since the scope the program is running in is the Lazarus-IDE itself,
(or maybe better said: the temporary "working directory" Lazarus created for the testrun. Not sure about that)
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

jcmontherock

  • Full Member
  • ***
  • Posts: 152
Re: Can't connect MySQL (cannot load library libmysql.dll)
« Reply #3 on: September 15, 2022, 04:30:52 pm »
Under Windows exe file is in the same directory as project by default...

Nicole

  • Sr. Member
  • ****
  • Posts: 486
Re: Can't connect MySQL (cannot load library libmysql.dll)
« Reply #4 on: September 16, 2022, 06:47:29 pm »
So if there is no quick hint here, translate this page:
https://lazarus.intern.es/firebird_lazarus_beachten.html

Do not get irritated by Zeos and Firebird.
The reason of the problems may be the same.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 538
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Can't connect MySQL (cannot load library libmysql.dll)
« Reply #5 on: September 16, 2022, 07:30:42 pm »
I am trying to connect my Lazarus application to MySQL. I have tried everything but it doesn't work. Could someone tell me how to do it step by step? I am working on Windows 10. Thank you very much.
step 1: open lazarus
step 2: code an application
step 3: save your project in its own named folder
step 4: compile and run your newly created project
step 5: explain "I have tried everything but it doesn't work." in steps we can reproduce and with information about "Error". "not work" is no error descripton.

Thanks and happy coding
« Last Edit: September 16, 2022, 07:32:36 pm by KodeZwerg »
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

 

TinyPortal © 2005-2018