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?
TZConnection connect failure
Moderators: gto, EgonHugeist
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.
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.