Page 1 of 1

IIS+MySql+Delphi ISAPI dll (using Zeos): libmysql missing?

Posted: 17.08.2012, 09:50
by Umbe
Hi all.

When calling a web app developed using Delphi2009 and installed on an IIS web server, I receive the following error message: "None of the dynamic libraries can be found: libmysql51.dll, libmysql50.dll, libmysql.dll".

The IIS (ver. 7.5) is on a remote Windows "Web Server 2008 R2" system (64bit OS); on the same machine I installed MySQL Community Edition 5.5.27 64 bit and Workbench 5.2.42 32bit. So far so good. The Workbench works fine and I can connect/create DB/create tables...

Now, on my development PC (Windows 7 Home Premium 64bit) I have RAD Studio 2009 and installed Zeos libraries (ver 7.0.0-dev) to build a web app to deploy on the above mentioned webserver.
Setting the properties of a ZConnection, a ZTable and a DataSetTableProducer I can see data table values in the Columns property of the latter. So, I guess, everything is set right and should work.

That's not the case.
When deploying my web app (project1.dll) on a properly configured directory on IIS, pointing a browser toward that "service" it gives me back the missing lib error mentioned above.

Other parts of the same web app works just fine (they're not db-related).
You can test it yourself by using the following URLs:
95.110.232.243/isola/project1.dll
95.110.232.243/isola/project1.dll/menu (same as above; it's the default action)
95.110.232.243/isola/project1.dll/table (this generate the ERROR on IIS).

I read a few posts about incompatibility between 64 and 32 libraries, directories where to copy a version of libmysql.dll (which one? actually I have got 3 of them..sigh!) and other tips, but they all seem not work for me.

Any suggestion?

Thank you.

Umberto
ps: I posted an identical message on dev.mysql.com forum Newbie to no avail.

Posted: 17.08.2012, 10:59
by EgonHugeist
Umbe,

hi, Zeos7.0.0dev isn't the right answer in this case. Please use our SVN. Download TortoiseSVN and use this download-URL http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing.

I didn't test your app, had no time. But i know the Alpha Previews had many problems with 64Bit and encodings. These are all solved on SVN.

So i suggest you download the latest files, and recompile them. One hint: Copy libmysql.dll (64Bit) To Windows\System32 and the libmysql(32Bit) to windows\sysWOW64. Then everything should work like expected.

Michael

Posted: 17.08.2012, 14:19
by Umbe
Hi Michael,

thank you for your reply. I'm totally new to svn, but I managed to have it working (well, everything downloaded and compiled, so..).

Did my best to accomplish all your suggestions but there's still something preventing the simple project1.dll to work correctly.

Now the error reads:
None of the dynamic libraries can be found or is not loadable: d:\inetpub\wwwroot\isola ! Use TZConnection.LibraryLocation if the location is invalid

The directory mentioned in the message is local to the webserver and that's where both project1.dll and libmysql.dll (copy of the one provided with MySQL server) reside. In the same directory I deployed libmysl55.dll from the svn download too. This dir is in the system path of the W2008 machine.
Just to fully follow you hint, I copied a 64bit version of libmysql in windows\system32 and a 32bit version (taken from workbench) in syswow64.

Obviously something's wrong with my chaotic setup!

My assumption is that IF I use TConnection.LibraryLocation that should be the only place where my webapp should search for libmysql.dll by means of zeoslib; so no need to have any copy of libmysql elsewhere on the webserver and no need to alter the system path. Am I wrong?

Secondly, if I don't set TConnection.LibraryLocation then the IIS will search for the libmysql.dll (requested at some point by zeoslib) following the system path, then windows\system32 (and/or windows\sysWOW64).

Don't know if my assumptions are correct..I'm here to solve the connection problem at hand and learn something along the way. So thanks again for your kind support.

Umberto

Posted: 17.08.2012, 14:38
by Umbe
IT WORKS!!!!

Sorry, Michael. You can disregard my previous message; now everything works as exepected.

My changes from last message:

1. set Connection.LibraryLocation to empty string in TConnection properties
2. set Connection.Catalog to information_schema (before it was empty)

Now I've just to selectively delete a few copy of libmysql.dll and see what happens...

When reading this message, if you a spare minute, can you please explain how to correctly use LibraryLocation (and Catalog, by the way)? Thank you again.

Umberto

Posted: 18.08.2012, 08:38
by EgonHugeist
Umbe,

great news. Ok how to use the LibraryLocation: Just type in a complete Patch+MyDLL.Name. The purpose of this property (as i made it) was to allow dll's/so/dylib files in different directories then the defaults and to make it possible to open a connection+database with a "OldDll.dll" and a second connection with a "NewDll.dll". Think about: The newer one does no longer support the old databases.

The catalog property has differences which are related to the Driver you use. For MySQL you can use your created Schema here.

Michael