In the my.cnf or my.ini (depending on which you have) net_read_timeout and net_write_timeout parameters (in seconds) should be increased or added. If the rows contain lots of data (blobs for example), then increasing the max_allowed_packet value may also resolve the issue. Furthermore, if you are using 4.0.15 and run it on Win platform, then you should upgrade because MySql screwd up the timeout settings…