I upgraded my laptop to Fedora Core 12, which has MySQL 5.1.42 installed. I have installed the latest Lazarus RPM, which is 0.9.28.2 and FPC 2.2.4. My Lazarus App won't connect to the server. I have the libmysqlclient.so.16.0.0 installed. I am not sure where to get the libmysqlclient.so.15.0.0. What are my options? Please do not recommend Zeos, On my installation I have never seen it compile correctly and if I have trouble a newbie would definitly have problems.
Mailing lists / lazarus / 2010-03
Lazarus & MySQL 5.1
19 messages · 9 people · –
- HHenry Vermaak 5
- MMarco van de Voort 3
- TTerry A. Haimann 3
- SSven Barth 2
- Wwaldo kitty 2
- JJoost van der Sluis 1
- +3 more
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Terry A. Haimann wrote 7 lines
since you're on linux, what's wrong with going into the dir where your libmysqlclient is and creating a link pointing to it for the 15 version you need? ;)
I upgraded my laptop to Fedora Core 12, which has MySQL 5.1.42 installed. I have…
Terry A. Haimann wrote 5 lines
Where does ".15.0.0" come from in this discussion? It is a filename that seems to have fallen from the air, connecting to nothing ?
Marco van de Voort wrote 9 lines
I presume it comes from here (in mysql.inc):
const
mysqllib = 'libmysqlclient.'+sharedsuffix;
{$IF DEFINED(mysql50)}
mysqlvlib = mysqllib+'.15';
{$ELSEIF DEFINED(mysql41)}
mysqlvlib = mysqllib+'.14';
{$ELSE}
mysqlvlib = mysqllib+'.12';
{$ENDIF}This probably doesn't cover all the cases. Assuming that a specific client library can only talk to a specific server may also be wrong. Debian testing also has libmysqlclient 16 and mysql-server 5.1.
Henry
Henry Vermaak wrote 17 lines
mysql version is a disaster (and one of the reasons why I avoid mysql when I can). IMHO FPC should never hardcode the number in the first place, but should link to mysqlclient.so (using the symlink, the unix way).
Anyway, long story short, FPC has a provision for such mistakes, -XLA
Try passing -XLAlibmysqlclient.so.15=libsqlclient.so.16 and pray.
since you're on linux, what's wrong with going into the dir where your libmysqlclient is…
I have tried this and it doesn't work.
waldo kitty wrote 19 lines
mysql version is a disaster (and one of the reasons why I avoid mysql when I can). IMHO…
How do I do this in Lazarus?
Marco van de Voort wrote 37 lines
I have tried this and it doesn't work.
Terry A. Haimann wroteI have tried this and it doesn't work.
in what way "it doesn't work"?? do you get an error or a complete failure with nothing indicating what went wrong?
FWIW: "it doesn't work" is pretty poor for an analysis to work from :P ;)
Show quoted text 13 lines
How do I do this in Lazarus?
How do I do this in Lazarus?
Project / Project Options / Compiler / Other
[...] > Try passing -XLAlibmysqlclient.so.15=libsqlclient.so.16 and pray.
Mattias
Hi together!
I'm using MySQL 5.1 without problems on my Linux machine.
Show quoted text 11 lines
The problem is not mysqlvlib as also mysqllib is checked for. The problem is the version string returned by the API. This is checked for in fcl-db/src/sqldb/mysql/mysqlconn.inc/TConnectionName.DoInternalConnect.
Until 5 months ago this only checked for '5.0', but since then (thanks to Joost) it also checks for '5.1'. But I don't think that this is even part of the 2.4.0 release...
You can also view my issue about this topic here: http://mantis.freepascal.org/view.php?id=14587
Regards,
Sven
mysql version is a disaster (and one of the reasons why I avoid mysql when I can). IMHO…
Marco van de Voort wrotemysql version is a disaster (and one of the reasons why I avoid mysql when I can). IMHO FPC should never hardcode the number in the first place, but should link to mysqlclient.so (using the symlink, the unix way).
I agree completely, and there is already a way to check the client library version in the mysql api.
Henry
Hi together! I'm using MySQL 5.1 without problems on my Linux machine. The problem is not…
Sven Barth wroteThe problem is not mysqlvlib as also mysqllib is checked for. The problem is the version string returned by the API. This is checked for in fcl-db/src/sqldb/mysql/mysqlconn.inc/TConnectionName.DoInternalConnect.
This is good to know, but the issue was that the compiler was trying to link against a version of a library that didn't exist on the system.
Henry
P.S. Your email client strips the references header, breaking threaded view, or perhaps you didn't reply to my message, but composed a new one?
Hi again!
Show quoted text 5 lines
As far as I see it, it tries to load two libaries dynamically: libmysqlclient.so.15 at first and libmysqlclient.so as fallback. On my system (ArchLinux) libmysqlclient.so is a symlink to the current version (.16), so the application is able to load it. Other systems (like Ubuntu and Co.) might ommit this symlink as it is only included with development packages. May be libmysqlclient.so.16 should be added as a SECOND accepted library version inside the mysql50 define in mysql.inc (and also in InitialiseMysql).
Show quoted text 5 lines
That is a known, expected and disturbing issue ^^. I check this mail account very seldom and so I'm using Digest Mode to not reach the memory limit (10MB) that fast. Also I'm prefering the web view on freepascal.org, so that I don't rely on a certain PC to read the messages (I'm using three: work, home, UMPC). Thus replying is a bit... well... thread breaking. If you have a good solution for this problem (modifying headers?), I'd love to read it :)
Regards,
Sven
mysql version is a disaster (and one of the reasons why I avoid mysql when I can). IMHO…
2010/3/2 Marco van de Voort :
Anyway, long story short, FPC has a provision for such mistakes, -XLA Try passing -XLAlibmysqlclient.so.15=libsqlclient.so.16 and pray.
Isn't this only useful for dynamic linking at compile time, not for dynamic loading at run time?
Vincent
I agree completely, and there is already a way to check the client library version in the…
Henry Vermaak wrote 8 lines
But what if they're dynamically loaded? Most users won't have the libname.so symlink installed.
Henry
Hi again! As far as I see it, it tries to load two libaries dynamically:…
Sven Barth wroteAs far as I see it, it tries to load two libaries dynamically: libmysqlclient.so.15 at first and libmysqlclient.so as fallback. On my system (ArchLinux) libmysqlclient.so is a symlink to the current version (.16), so the application is able to load it. Other systems (like Ubuntu and Co.) might ommit this symlink as it is only included with development packages. May be libmysqlclient.so.16 should be added as a SECOND accepted library version inside the mysql50 define in mysql.inc (and also in InitialiseMysql).
Yes, the development package must be installed for the .so symlink to be created. This is o.k. for developers, but doesn't particularly help users. The .16 library needs to be added to the list, you're right, but .15 must also be there.
Show quoted text 9 lines
I thought you might be using digest mode, but it's also stripping the reference. I don't think there's much you can do about it, either way.
Henry
mysql version is a disaster (and one of the reasons why I avoid mysql when I can). IMHO…
Marco van de Voort wrote 22 lines
That's impossible for MySQL.
Because, for example, an 'integer' field in version .13 can have the id 1, but for version .14 the id 1 can be used for a 'varchar'.
There is no way to know what the field-type of a column is, if you don't take the MySQL version into account.
To avoid these kind of problems most distributions come with more version of the mysql-client libraries, which they call .15, .16 etc. So fpc first tries to find the right client-version (using the .15 suffix) and then the general one.
Why MySQL 5.1. doesn't works is because as an extra check it checks if the version number is the number it expects. That check doesn't search for mysql 5.1 for older versions of fpc. (including 2.4.0)
Anyway, long story short, FPC has a provision for such mistakes, -XLA Try passing -XLAlibmysqlclient.so.15=libsqlclient.so.16 and pray.
Doesn't work. The version check will fail.
Bottom-line: don't use MySQL. And do not upgrade your MySQL-client library version.
Joost.
Joost van der Sluis wroteBottom-line: don't use MySQL. And do not upgrade your MySQL-client library version.
Currently i don't use client server client server i would prefer Firebird given other experiences. But the problem is that most web host companies only offer MySQL. Very few offer Firebird.
Luiz
But what if they're dynamically loaded? Most users won't have the libname.so symlink…
Henry Vermaak wrote 7 lines
IMHO that should be dealt with by a application specific configuration system, and left to the programmer.
It is not something that IMHO the libs should try to decide for everybody.
