1071 Specified key was too long – Laravel 5.4

How to fix – 1071 Specified key was too long error

[IlluminateDatabaseQueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
[PDOException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
To fix this issue,
Go to app/Providers/AppServiceProvider.php file and add following code  into boot method
do not forget to add

About the author

Yunus Shaikh

Yunus is Laravel / Angular developer. Specialized in Building REST APIs . Yunus care deeply about delivering Quality work. He also Have hands on Experience on WordPress, HTML, CSS, JavaScript technologies. Yunus love to explore emerging tech stuffs.

View all posts

Leave a Reply

Your email address will not be published.