Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specified key was too long; max key length is 767 bytes #1108

Closed
kisssg opened this issue May 20, 2019 · 2 comments
Closed

Specified key was too long; max key length is 767 bytes #1108

kisssg opened this issue May 20, 2019 · 2 comments
Labels

Comments

@kisssg
Copy link

kisssg commented May 20, 2019

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access
violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: a
lter table model_has_permissions add index model_has_permissions_model_id_mod el_type_index(model_id, model_type))

@kisssg
Copy link
Author

kisssg commented May 20, 2019

tableName_columnName1_columnName2_index

@drbyte drbyte added the support label May 20, 2019
@drbyte
Copy link
Collaborator

drbyte commented May 20, 2019

In Laravel 5.4 the default character set changed to utf8mb4, therefore if you are running MariaDB or MYSQL version lower than 5.7.7 you may get that error when trying to run migration files.
Your app requires a configuration setting change:
https://laravel-news.com/laravel-5-4-key-too-long-error

@drbyte drbyte closed this as completed May 20, 2019
@drbyte drbyte changed the title why index name so long that it cant be created Specified key was too long; max key length is 767 bytes May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants