Page 1 of 1

ZConnection.Connect is too slow on my MySQL

Posted: 21.04.2009, 11:50
by magrossi
Hi,

I have MySQL 5.1 installed on my Windows 2000, Pentium IV 1.6Ghz 512Mb, machine and I'm using the ZeosLib 6.6.4 (stable) components for Delphi 6 to connect my database.
The components work great! Thanks all for this great package! But I'm having an annoying problem. Whenever I call connect from my ZConnection component to work with one of my databases (very small, 1 table, < 100 rows) it takes up to 30 seconds to execute.
I was able to trace the slow code down to this command:

ZDbcMySQL.pas, line 457
{ Connect to MySQL database. }
if FPlainDriver.RealConnect(FHandle, PChar(HostName), PChar(User),
PChar(Password), PChar(Database), Port, nil,
ClientFlag) = nil then
All I configured was user, password, hostname (localhost), port (3306) and protocol (mysql-5 or mysql). I know that all of these are correct because I can normally connect to my MySQL database using other means, i.e. EMS MySQL Manager Lite, MySQL command line client, etc. The problem also occurs when executing the example applications that came with the component.
When connecting to my databases from other programs, like the ones mentioned above the connection is instantaneous. Only from my own program, using ZeosLib TZConnection that the actual connection takes this very unusual time.

I'm sure I've done something wrong, but I would appreciate alot your help on solving this issue.

Thank you very much!

Posted: 22.04.2009, 12:45
by zippo
Could be some IP resolving related problem..?

Posted: 22.04.2009, 14:17
by magrossi
I'm not sure. But I find it difficult because I am using "localhost" as my address...

Posted: 03.05.2009, 23:19
by mdaems
Did you solve this already?

If not I can only see 2 possibilities
- A firewall fighting your program
- IP resolving problems

Did you try to connect to a database server installed somewhere else on the network?
Tried the 127.0.0.1 address?

Mark

Posted: 19.05.2009, 14:02
by magrossi
Hi all,

Just to give a feedback on this. I believe this was due to McAfee Firewall interfearance. Although I had it properly configured to allow all traffic to the proper TCP port and all my applications.
The problem was solved by full uninstall of McAfee..

Thanks to take the time and answer Mark and Zippo!

Posted: 19.05.2009, 14:32
by zippo
It's been a pleasure. I'm happy you solved your issue.