Page 1 of 1

Lost connection on alter table ... create index

Posted: Wed 13 Apr 2005 09:23
by lfelicetti
Hello, i've got a problem with mydac. I'm woking wih big tables and a need to reindex that. I suppose to use an alter table query for delete old index and add new one. MyDAC tell me a Lost Connection during query.

This is my query:
ALTER TABLE `mydb`.`a` DROP INDEX `a`,
ADD INDEX `a`(`a`),
DROP INDEX `b`,
ADD INDEX `b`(`b`),
DROP INDEX `c`,
ADD INDEX `c`(`c`)
, DROP INDEX `d`,
ADD INDEX `d`(`d`);

Rows on mydb.a: 617747

The query on my system takes about 25secs

Delphi 2005 update pack 2
MyDAC 3.50.0.18

Any suggestion?

Posted: Thu 14 Apr 2005 08:56
by Ikar
What value did you assign to CommandTimeout?

Command Timeout

Posted: Thu 14 Apr 2005 09:53
by lfelicetti
the value 9999999

Posted: Thu 14 Apr 2005 11:29
by Ikar
Please try to set TMyConnection.Options.Direct to False.

Posted: Thu 14 Apr 2005 15:03
by lfelicetti
Tried also. Doesn't work.

Posted: Thu 14 Apr 2005 15:28
by Ikar
> Tried also. Doesn't work.

Judging by these tests the error is somewhere in server settings. Try to learn MySQL Reference Manual, chapter A.2 Some Common Errors When Using MySQL (CR_SERVER_LOST)