1

In the documentation for myisamchk, it says:

--quick, -q

Achieve a faster repair by modifying only the index file, not the data file. You can specify this option twice to force myisamchk to modify the original data file in case of duplicate keys.

Does this really mean to execute the command like myisamchk -qq table_name??? In fact, I tried this, but I still get many errors of the form:

myisamchk: warning: Duplicate key for record x against record at y

Can I assume that myisamchk is correctly deleting duplicates? As a side-question, what is a good way to check a table for duplicates?

Per request, results of SHOW CREATE TABLE:

Table: entities5
Create Table: CREATE TABLE `entities5` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`ext_id` bigint(20) unsigned NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`first_name` varchar(130) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_name` varchar(130) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`locale` char(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`gender` tinyint(1) DEFAULT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`name`,`id`),
UNIQUE KEY `ext_id` (`ext_id`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
1
  • Please show the table structure using SHOW CREATE TABLE mytable\G Sep 21 '12 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.