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
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
Post a Comment