Mysql “Specified key was tooo long ; max key length is 767 bytes”
when i use gogs on my raspberry pi to build a personal git server
it maybe using a mysql script , it give me a this
" Specified key was tooo long ; max key length is 767 bytes"
the following command is the solvtion:
basiclly :
- check if
innodb_large_prefix is on
- check if
innodb_file_format is Barracuda
- if is not . change it to the value.
MariaDB [gogs]>
MariaDB [gogs]> show variables like 'innodb_large_prefix';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| innodb_large_prefix | OFF |
+---------------------+-------+
1 row in set (0.00 sec)
MariaDB [gogs]> set global innodb_large_prefix = on;
Query OK, 0 rows affected (0.00 sec)
MariaDB [gogs]> show variables like 'innodb_large_prefix';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| innodb_large_prefix | ON |
+---------------------+-------+
1 row in set (0.01 sec)
MariaDB [gogs]> show variables like 'innodb_file_format';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| innodb_file_format | Antelope |
+--------------------+----------+
1 row in set (0.01 sec)
MariaDB [gogs]> set global innodb_file_format = barracuda;
Query OK, 0 rows affected (0.00 sec)
MariaDB [gogs]> show variables like 'innodb_file_format';
+--------------------+-----------+
| Variable_name | Value |
+--------------------+-----------+
| innodb_file_format | Barracuda |
+--------------------+-----------+