ZConnection.Connect is too slow on my MySQL

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
magrossi
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 21.04.2009, 11:30

ZConnection.Connect is too slow on my MySQL

Post 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!
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

Could be some IP resolving related problem..?
magrossi
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 21.04.2009, 11:30

Post by magrossi »

I'm not sure. But I find it difficult because I am using "localhost" as my address...
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
magrossi
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 21.04.2009, 11:30

Post 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!
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

It's been a pleasure. I'm happy you solved your issue.
Post Reply