MySQL raises EE_LINK_WARNING (Error 18) when a CHECK or REPAIR operation detects mismatched link counters in a MyISAM or ISAM table, signaling possible data corruption.
MySQL Error 18 EE_LINK_WARNING appears when CHECK TABLE or REPAIR TABLE finds link inconsistencies inside MyISAM or ISAM files. Rebuild the table with myisamchk --recover or run ALTER TABLE ... ENGINE=InnoDB to eliminate the bad links and clear the warning.
Warning: '%s' had %d links
MySQL emits “Warning: '%s' had %d links” with error code 18 (symbol EE_LINK_WARNING) when it discovers a mismatch between the stored link counter and the actual number of rows in a MyISAM or legacy ISAM table.
The warning usually surfaces during CHECK TABLE, REPAIR TABLE, OPTIMIZE TABLE, or myisamchk commands, indicating internal pointers that no longer reference valid rows.
Ignoring it risks wrong result sets and replication drift.
The server or myisamchk sets the warning flag after abnormal shutdowns, interrupted writes, disk faults, or improper file copies that leave .MYI headers out of sync with .MYD data pages.
It can also appear after bulk DELETE or TRUNCATE operations if the link counter update fails to flush to disk on older MySQL versions (5.7 and earlier).
Link‐counter corruption may hide orphaned rows or phantom entries that break foreign-key logic, full-text indexes, and incremental backups.
Fast remediation maintains data integrity and avoids cascading errors during replication or logical export.
Hardware I/O errors, abrupt power loss, and OS crashes are primary triggers. Manual file moves without FLUSH TABLES WITH READ LOCK can desynchronize file metadata. Running out of disk space during writes is another frequent cause.
First, isolate the affected table with a READ LOCK. Then run myisamchk --recover or REPAIR TABLE tbl_name QUICK.
If corruption persists, rebuild by dumping and reloading or migrating to InnoDB.
On replicas, stop SQL thread, copy a clean .MYD/.MYI pair from the primary, and start replication. For high-availability clusters, fail over first to preserve uptime, then repair the offline node.
Store tables on reliable storage with write-cache safely off. Enable sync_binlog and innodb_flush_log_at_trx_commit for transactional engines.
Schedule regular CHECK TABLE in low-traffic windows, and prefer InnoDB for new tables.
Error 127 (ER_UNKNOWN_ERROR) often accompanies severe MyISAM corruption. Error 1194 (ER_WARNING_NOT_COMPLETE_ROLLBACK) signals partial rollbacks. Their root causes and fixes overlap; a full dump-reload cycle resolves both.
.
While labeled a warning, it indicates metadata corruption that can yield incorrect query results if left untreated.
No. Hidden corruption can surface later, cause replication errors, or block backups. Always repair promptly.
No. The warning is specific to MyISAM and ISAM tables. Migrating to InnoDB eliminates this risk.
Galaxy’s versioned query workspace encourages scheduled CHECK TABLE routines and surfaces engine warnings immediately in the editor, prompting early fixes.