TZConnection connect failure

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
AlanTse
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 14.04.2009, 04:38

TZConnection connect failure

Post by AlanTse »

I got a TZConnection by assigning the parameters:
host, user, password and port.

I worked fine in my application, I can connect to the MySQL version 5.

Now I have second application, put the same TZConnection in the datamodule, also assign
host, user, password and port
at runtime.

However, when I called
Connection.Connect;

I got an exception:
EZSQLException with message
'SQL Error: Client does not support authertication protocol requested byserver; consider upgrading MySQL client'

I have already the libmysql.dll in both application's directory.
Any idea why the first one worded fine but not the second?
AlanTse
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 14.04.2009, 04:38

Post by AlanTse »

Hi,

I also tried at design time by assigning:
host, user, password and port.

Then set connect to true, got the same exception.
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post by gto »

That's normally caused by a lost libmysql.dll in your system, porbably an outdated one. Try to find all libmysql you have in the system and concentrate them in only one place (system's dir or your app's dir).

When testing in designtime/runtime you get another complication. In runtime, the library will be searched in the local app's folder and them through system paths, but as windows is windows, this can change anytime.

In designtime, there's another bug that Delphi sets the app's local folder for the latest folder you searched something. Ex: You have only one libmysql in entire system and it's into your app' dir. After opening the project in delphi, it will work when you try to connect in deigntime. Then you open a TImage component and look for an image to put into it. Now the delphi's local folder is set to this image's folder, and if you try to connect in designtime, it will not work anymore (lib not found).

This don't occurs everytime, but can set you nuts.
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

I agree with gto. This error only occurs when the program loads a libmysql file with a version number lower than 4.1.1 (according to mysql docs).

Mark
Image
AlanTse
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 14.04.2009, 04:38

Post by AlanTse »

Thanks for your comments.
Yes, finally I found the libmysql.dll is an out-dated one.
I replaced with the latest version 5 one and it works now.
Post Reply