๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ปTech/๐ŸฌMySQL

[MariaDB] Specified key was too long; max key length is 767 bytes

by _viper_ 2020. 2. 3.
๋ฐ˜์‘ํ˜•

MariaDB์—์„œ ranger db ์ƒ์„ฑํ•  ๋•Œ๋งˆ๋‹ค ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค... ๊นŒ๋จน์ง€ ์•Š๊ฒŒ ์ ์–ด๋‘ ..

์ดˆ๊ธฐ์— ์„ธํŒ…ํ•ด๋‘๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค.

 

๐Ÿ’ก ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  • my.cnf์— ์•„๋ž˜ ์˜ต์…˜ ์ถ”๊ฐ€ ํ›„ mariaDB ์žฌ๊ธฐ๋™
$ vi /etc/my.cnf

[mysqld]
...
innodb_file_format = barracuda
innodb_large_prefix = on

 

โœ… ์žฌ๊ธฐ๋™ ํ›„ ํ™•์ธ ๋ช…๋ น์–ด

MariaDB [(none)]> SHOW VARIABLES LIKE 'innodb_lar%';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| innodb_large_prefix | ON    |
+---------------------+-------+

MariaDB [(none)]> SHOW VARIABLES LIKE 'innodb_file%';
+--------------------------+-----------+
| Variable_name            | Value     |
+--------------------------+-----------+
| innodb_file_format       | Barracuda |
| innodb_file_format_check | ON        |
| innodb_file_format_max   | Barracuda |
| innodb_file_per_table    | ON        |
+--------------------------+-----------+