Mysql error 1071 : Specified key was too long; max key length is 767 bytes
See original GitHub issueI’m using mysql with encoding set as utf8mb4
.
Because of that, an index on a column larger than 191 characters will trigger a mysql error 1071 when migrating djcelery
django.db.utils.DatabaseError: (1071, 'Specified key was too long; max key length is 767 bytes')
I’ve tried tons of different stuff in order to make that work, but the only working solution I came up with was to fork the project, and reduce all columns that caused the error to 191 chars.
Any help here would be extremely appreciated !
Issue Analytics
- State:
- Created 10 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
MySQL Error #1071 - max key length is 767 bytes
767 bytes in MySQL version 5.6 (and prior versions), is the stated prefix limitation for InnoDB tables. It's 1,000 bytes long for MyISAM...
Read more >How to resolve: Specified key was too long; max key length is ...
The length() function (http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_length) returns the number of bytes, not characters ...
Read more >1071 Specified key was too long; max key length is 767 bytes
That exceed the 767 bytes limit for an index. The easy workaround is to limit the size of the key/index to 191 VARCHAR...
Read more >Specified key was too long; max key length is 767 ... - YouTube
Free Linux cheat sheet found here: http://eepurl.com/dkRNM9This video shows how to correct the error : ERROR 1071 (42000): Specified key was ...
Read more >Error message: The key was too long, MAX key length is 767 ...
Error message: The key was too long, MAX key length is 767 bytes. Resolved samuelmartin ... This error normally occurs on old MySQL...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For avoiding this error in MariaDB just specify utf8_general_ci at creation time:
create database database_name default CHARACTER set utf8 default COLLATE utf8_general_ci;
If you can’t create a new database, just convert it. It will avoid this error.
Closing this issue since it’s now been a few years and I haven’t worked with django-celery in a while