Recent

Author Topic: Missing libmysql  (Read 11520 times)

tormods

  • New Member
  • *
  • Posts: 17
Missing libmysql
« on: March 28, 2014, 09:04:54 am »
I trying to use MariaDB instead of MySql which should be compatable with MySql. The problem is the "libmysql.dll" file and placement of this. I' am running both win 32 applications both in Lazarus and MariaDB. From internet I have found that this file should be placed in windows\system 32, and I have tried this with no success. The MariaDB is in version 5.5.x, and I am using the 5.5 connector, checking it out the MariaDB is really version 5.3. I am not sure that this creates incompability.
I think it shoud be og great interest to lazarus community to have a working condition towards MariaDB due to its licencing policy, so is there anyone that can help me- itcomes very frustrating not to be able to start the "real work"

Tormods

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Missing libmysql
« Reply #1 on: March 28, 2014, 09:29:01 am »
You can use control panel to set environment variable:
ControlPanel->System->Advanced system settings->Environment variables
use path->edit and put path to client lib(e.g. C:\Program Files\mysql\bin\)

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Missing libmysql
« Reply #2 on: March 28, 2014, 09:30:22 am »
Maybe you need to restart PC

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7458
Re: Missing libmysql
« Reply #3 on: March 28, 2014, 10:15:06 am »
To test, just put a copy of the DLL

(1) next to the lazarus binary (for the designtime parts, if needed)
(2) one in the directory of the application EXE

If it then still fails to load, maybe mysql.dll has some problems (like depending on other DLLs).

Patches that improve Lazarus can be contributed through the bugtracker (bugs.freepascal.org). Set the project to "FPC" since the DLL loading is inside the FPC codebase.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Missing libmysql
« Reply #4 on: March 28, 2014, 10:21:59 am »
Please:
- Putting the dll in windows\system32 is ok if you're on 32 bit windows. On 64 bit windows, 32 bit dlls go into windows\syswow64.
- As Marco's indicated, there may be more dlls needed (e.g. compression/encryption dlls).
- For Laz/FPC it is important to make sure the client dll and the connector match, which you seem to have done. Whether that client dll and db server can talk to each other depends on mariadb's compatibility/support. No idea about that; perhaps mariadb have docs about it
- Have you searched the forum for other people with mariadb having problems? What did they tried

Please read
http://wiki.lazarus.freepascal.org/mysql


Thanks
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

mangakissa

  • Hero Member
  • *****
  • Posts: 941
Re: Missing libmysql
« Reply #5 on: March 28, 2014, 11:20:52 am »
Quote
Whether that client dll and db server can talk to each other depends on mariadb's compatibility/support. No idea about that; perhaps mariadb have docs about it
Just test libmysql.dll v5.5 on mariaDB  and MySQLconnection55 and as far as I could see it's working fine.
But supporting MariaDB should be appreciated (even MySQL 5.6)
Lazarus 1.84 (32b) / FPC 3.0.4
Windows 10

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Missing libmysql
« Reply #6 on: March 28, 2014, 11:25:00 am »
@mangakissa: so what should be changed so that MariaDB can be supported? Looking for a different dll name? Which one?

Something else?

If so, interested parties should file a bug report with details.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7458
Re: Missing libmysql
« Reply #7 on: March 28, 2014, 11:45:22 am »
But supporting MariaDB should be appreciated (even MySQL 5.6)

Doesn't the 5.6 connector support MariaDB then?


mangakissa

  • Hero Member
  • *****
  • Posts: 941
Re: Missing libmysql
« Reply #8 on: March 28, 2014, 01:30:23 pm »
@mangakissa: so what should be changed so that MariaDB can be supported? Looking for a different dll name? Which one?

Something else?

If so, interested parties should file a bug report with details.
Why is it chosen to make components like TMySQL40connection, TMySQL41connection, TMySQL50connection, TMySQL51connection and TMySQL55connection. SQLdb works with client libraries, witch are the real connectors to MySQL. Mariadb is 99% compatible with MySQL and have some extra functionals. So why not build a TMariaConnection with the specific library for MariaDB (libmariadb.dll).
It's not a bug. Its just like tormods said:
Quote
I think it shoud be og great interest to lazarus community to have a working condition towards MariaDB due to its licencing policy
.
Lazarus 1.84 (32b) / FPC 3.0.4
Windows 10

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Missing libmysql
« Reply #9 on: March 28, 2014, 01:43:34 pm »
@mariadb users:
So apparently the problem is that the dll name is not libmysql.dll but libmariadb.dll?

1. this
http://wiki.lazarus.freepascal.org/SQLDBLibraryLoader
should allow you to specify the dll name.
Note: the mysql connector may also have similar functionality for its library, haven't looked at it (I try to stay away from mysql as much as possible)

2. I agree that it would be a good idea to have built in support for mariadb; please open a bug report with the request to add libmariadb to the list of default library names for (recent) TMySQL*connectors. Also please specify what is the oldest mariadb version so that we can only update the relevant TMySQL* connectors.

Why is it chosen to make components like TMySQL40connection, TMySQL41connection, TMySQL50connection, TMySQL51connection and TMySQL55connection. SQLdb works with client libraries, witch are the real connectors to MySQL. Mariadb is 99% compatible with MySQL and have some extra functionals. So why not build a TMariaConnection with the specific library for MariaDB (libmariadb.dll).
It's not a bug.
1. Having various mysql connector is not our choice but a consequence of mysql deliberately(?) breaking their API so that you need a different connector for a different client library version. If you have a sensible solution that unifies all mysql client versions into one connector, PLEASE provide a patch so we can get out of this mess.
2. So apparently there is a "bug" (or missing feature) because the mysql connectors will look for libmysql.dll and not libmariadb.dll. So the solution would be to extend the default search names to add that.
« Last Edit: March 28, 2014, 01:45:14 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

mangakissa

  • Hero Member
  • *****
  • Posts: 941
Re: Missing libmysql
« Reply #10 on: March 28, 2014, 02:24:28 pm »
Quote
1. this
http://wiki.lazarus.freepascal.org/SQLDBLibraryLoader
should allow you to specify the dll name.
Note: the mysql connector may also have similar functionality for its library, haven't looked at it (I try to stay away from mysql as much as possible)
Yes, but what tormods mentioned in his first topic: Some way the TMySQL{XX}connections looks witch version of dll will be loaded and tells, even using the libraryloader, the dll is not compatible.
But the library is taken from MariaDB 5.5
Lazarus 1.84 (32b) / FPC 3.0.4
Windows 10

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Missing libmysql
« Reply #11 on: March 28, 2014, 03:29:14 pm »
I have trouble understanding what you are writing. I don't see tormods mentioning libraryloader but I may have overlooked it. Are you trying to say you just tested mariadb with libraryloader?

In any event, the best way of getting this fixed is to file a bug report with *all* relevant details.

Edit: clarified why I posted this
« Last Edit: March 28, 2014, 03:31:04 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified