Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Workaround for install problem, with MySQL and "1071 - Specified key was too long; max key length is 767 bytes" #2115
Bug Workaround Summary
This is a report to document how I solved a problem I encountered when installing YOURLS. The installer - browser pointed at https://myurl/admin/install.php - took me to the "install" screen, and the install with the message:
as also described in #1793
In my case, despite what the error reported, the tables yourls_options and yourls_log were in fact created, but yourls_url was not. I tried creating it manually in my YOURLS database, using
however this failed with an error:
I was able to get the installer to work by changing the global MySQL configuration in /etc/mysql/my.cnf by a) ensuring that innodb_file_format = barracuda was set in the [mysqld] section, and then adding the line (directly beneath it, by itself):
I was then able to manually create the yourls_url table using this create statement:
In my case, I used the utf8mb4 charset and utf8mb4_unicode_ci collation, others might choose different values.
I hope this helps someone - and perhaps a more informative error message could be provided by the YOURLS installer...
Many thanks for covering this issue and presenting your solution. Much appreciated.
TL;DR : if using InnoDB instead of MYISAM, enable