MySQL ERROR 1069
MySQL error 1069 는 다음과 같이 나타난다.
ERROR 1069 (42000): Too many keys specified; max 64 keys allowed
일반적으로는 타당한 사용은 아니고, MySQL 테이블에 64개의 인덱스보다 더 많이 요구했을 때 발생한다. 그러나 이 에러메시지는 반드시 이런 경우에만 나타나는 것이 아니라, 명시적으로 인덱스를 지정하지 않았을 경우에도 발생할 수 있다.
mysql> alter table TB_1 add index id_1 (name);
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table TB_1 add index id_1 (name);
ERROR 1061 (42000): Duplicate key name 'name'
mysql> alter table TB_1 add index (name);
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table TB_1 add index (name);
Query OK, 0 rows affected, 1 warning (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 1
Note (Code 1831): Duplicate index 'name_2' defined on the table 'TB_1'. This is deprecated and will be disallowed in a future release.
mysql> call common_schema.run("
"> foreach($i: 1:100)
"> {
"> alter table TB_1 add index (name);
"> }
"> ");
ERROR 1069 (42000): Too many keys specified; max 64 keys allowed
해결책은 간단하다. 인덱스를 생성시 명시적으로 이름을 지정하면 된다.
By 윤성용