Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.3Mb
PDF (A4) - 41.3Mb
PDF (RPM) - 39.6Mb
HTML Download (TGZ) - 9.3Mb
HTML Download (Zip) - 9.3Mb
HTML Download (RPM) - 7.8Mb
Man Pages (TGZ) - 260.6Kb
Man Pages (Zip) - 371.8Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb
Excerpts from this Manual

B.3.6.1 Problems with ALTER TABLE

If you get a duplicate-key error when using ALTER TABLE to change the character set or collation of a character column, the cause is either that the new column collation maps two keys to the same value or that the table is corrupted. In the latter case, you should run REPAIR TABLE on the table. REPAIR TABLE works for MyISAM, ARCHIVE, and CSV tables.

If you use ALTER TABLE on a transactional table or if you are using Windows, ALTER TABLE unlocks the table if you had done a LOCK TABLE on it. This is done because InnoDB and these operating systems cannot drop a table that is in use.