[Err] 1071 – Specified key was too long; max key length is 767 bytes
This will appear on mysq5 7 or below because InnoDB is not enabled_large_prefix
MySQL 5.6:
MySQL 5.7:
Simple method: if the requirement is not very high, you can also directly set the table field varchar (255) to varchar (64)
The other is to modify the configuration (the service will become invalid after restarting)
mysql> show variables like '%innodb_large_prefix%'; +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | innodb_large_prefix | OFF | +---------------------+-------+ 1 row in set mysql> set global innodb_large_prefix=on; Query OK, 0 rows affected mysql> show variables like '%innodb_large_prefix%'; +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | innodb_large_prefix | ON | +---------------------+-------+ 1 row in set
Similar Posts:
- [Solved] MYSQL5.6 Error: ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes.
- [Solved] Mysql ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- How to Solve Mysql Error 1206: The total number of locks exceeds the lock table size
- ERROR 2006 (HY000): MySQL server has gone away No
- [Solved] MYSQL Export Sheet Error: –secure-file-priv option so it cannot execute this statement
- The ‘INFORMATION_SCHEMA.GLOBAL_STATUS’ feature is disabled; see the documentation for …
- Loading local data is disabled; this must be enabled on both the client and server sides
- [Solved] MYSQL Error 1040 (HY000): too many connections
- ERROR 1820 (HY000): Unknown error 1820 [How to Solve]