libmysql - no it isn't solved! lazarus / 16-Databases ---------------------------------------------------------------------- Baldur2630 · 2013-03-22 17:39 Until 7 years ago when I retired, I was a Delphi 5 programmer. I wrote quite a lot of things including some utilities for Novell NDS. Since I retired, I haven't done any programming at all - sad, so I decided to start again, because I have a MAC now as well as a Windows 7 machine. I installed Lazarus on my MAC, without a problem. I installed Lazarus on my Windows 7 machine, without a problem. I installed Lazarus on one of my CentOS 6.2 Servers again without a problem. But then the brown stuff hit the fan. Everything I have and want is on MySQL databases, so the most (if not ONLY) important thing is that I can access my MySQL databases. I have MySQL installed on my MAC and the MySQL Workbench, I have MySQL installed on CentOS and the MySQL Workbench and I have the MySQL Workbench installed in Windows 7 x64. In spite of all this and libmysql is on ALL the machines, (they are all 5.5.x). I get this same b****y irritating message if I try to use any MySQL component. Will someone PLEASE tell me in which Folder(s) / Directory I need to have the libmysql in, because I've tried ever one that I can think of system, system 32, syswow64 and just about every Lazarus folder, but still the same message. I even tried installing a 32-bit Windows 7 Virtual machine on VMware Workstation and even that gives the same problems. I've searched the web and tried every solution I've been able to find but I still get the same irritating message, Pretty please with multiple cherries on top will someone please tell me how to sort this before I delete Lazarus and give up. ---------------------------------------------------------------------- goodname · 2013-03-22 17:47 My understanding is that Windows looks in the present working directory first. It then looks in system "path" environment variable for dll files. Assuming that you have tried one or both of these already. ---------------------------------------------------------------------- Baldur2630 · 2013-03-22 17:57 All of the above FYI - EVERYTHING is on 64-bit. I can't see the point in using anything 32-bit when most machines have 4, 8 or 16 GB RAM. I hope you aren't going to tell me that Lazarus only works on 32-bit, because it that's true, I may as well delete it now. ---------------------------------------------------------------------- goodname · 2013-03-22 18:07 Lazarus works on 32 and 64 bit machines. But that has nothing with where Windows looks for dll files. ---------------------------------------------------------------------- fabienwang · 2013-03-22 18:21 Hi, Lazarus MySQL component works with 5.1 libs, but doesn't work with 5.5 version (i tried and had errors). You can get the 5.1 lib version on mysql website. ---------------------------------------------------------------------- goodname · 2013-03-22 19:35 The current FPC 2.6.2 release that comes with Lazaurs 1.0.8 supports MySQL 4.0 - 5.5 ---------------------------------------------------------------------- Leledumbo · 2013-03-22 21:10 Lazarus and FPC version? MySQL 5.5 support is quite new, so if your version isn't the latest you won't get it. And no, 5.1 is NOT compatible with 5.5, so both component and library version must match. ---------------------------------------------------------------------- itmitica · 2013-03-22 22:26 Quote from: Baldur2630 on March 22, 2013, 06:39:18 pmIn spite of all this and libmysql is on ALL the machines, (they are all 5.5.x). I get this same b****y irritating message if I try to use any MySQL component. They have to match. That is, if Lazarus 64 bit then MySQL 64 bit, else if Lazarus 32 bit then MySQL 32 bit. Otherwise, you get the above message, even if the (wrong) lib is found in the path. Quote from: Baldur2630 on March 22, 2013, 06:39:18 pmWill someone PLEASE tell me in which Folder(s) / Directory I need to have the libmysql in, because I've tried ever one that I can think of system, system 32, syswow64 and just about every Lazarus folder, but still the same message. Project folder will do. But you can also modify system path to point the said dlls. That way you don't have to keep copying the lib in very project's folder that involves MySQL. Just tested with MySQL 32bit 5.5, Lazarus 32bit 1.0.8/ FPC 2.6.2. I can confirm it works. -- Mitică ---------------------------------------------------------------------- BigChimp · 2013-03-23 05:46 In addition to wihat itmica said, an even easier way of getting the dlls to be picked up is to just - put them in c:\windows\system32 (yes, this is the place for 64 bit libraries on x64 Windows ) Also (partly repeating what others said): - match bitness of your mysql dlls (e.g. 64 bit Lazarus=>64 bit mysql dlls) - match mysql client version with the Lazarus components (4.0,5.0,5.1...) you're using. Mysql client version is independent from mysql server version. - copy over *all* required dlls. I suspect there may be some ssl dlls needed, too, but you'll need to check - what documentation have you read about installing the mysql client? What did it say? What was unclear? - when posting questions, please let us know your Lazarus version as well as your OS. I'm thinking you have 1.0.6 as you mentioned you just installed it. This means you have FPC 2.6.2 Hope it works for you, please let us know. Also, welcome & hope you enjoy Lazarus See also pages like: http://wiki.lazarus.freepascal.org/mysql http://wiki.lazarus.freepascal.org/Lazarus_Database_Overview There is also official documentation on the database components http://www.freepascal.org/docs-html/fcl/sqldb/index.html ---------------------------------------------------------------------- sam707 · 2013-03-23 06:32 very simple way to use libmysql.dll without invading or propagating it into ur system : go on the oracle website and download the mysql-no-install.zip file(s) 32 bits / 64bits or both upon your needs. - unpack libmysql.dll in your lazarus binaries directory (where Lazarus.exe is on your computer)   this is because lazarus IDE uses it at runtime when you set DBControls active at design time - also unpack the dll in your project executable , letting your application access the library while standalone normal running thats all EASY !! don't forget to use each time the correct version of the library (32bit with 32bits lazarus/app, 64bit with 64bits lazarus/app ) finally , when you will distribute your application , ship the dll to be copied in the install folder with your app's executable. i think my method is the best = bypassing other versions of the dll used by windows and/or other apps, keeping version consistancy