Max key length is 767! Getting ERROR 1071 (42000) at line 1127: Specified key was too long; max key length is 767 bytes while restoring mysql dump file?

This usually happens with Mariadb databases. To solve the issue create database with default utf i.e with  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci.

Then login into mysql:
#mysql -u username -p

And set the following settings:

MariaDB [(none)]> SET GLOBAL innodb_file_format=Barracuda;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> SET GLOBAL innodb_large_prefix=on;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> SET GLOBAL innodb_file_per_table=on;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit


This should solve your issue.

Comments

Popular posts from this blog

(Solved) (Fixed )MariaDB Unmet Dependencies on Ubuntu 20.04.

Solution to Moodle Error: Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write.

ACTION_FAILED:OU_INVALID: Solution for GoogleApps bulk user upload issue, username@domainname.com:ACTION_FAILED:OU_INVALID. This error is because you have not specified the Org Unit Path properly.