davy_yg's avatar
Level 27

Laravel Fixed Next Version?

I wonder why everytime I installed a new laravel version this error will appears:

Illuminate\Database\QueryException : 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))

Eventhough, I have the solution:

ref: https://laravel-news.com/laravel-5-4-key-too-long-error

Would it be better if the fixed is straight from the laravel next version?

0 likes
4 replies
bobbybouwmann's avatar

This depends on the MySQL database version you're using. Also from the same article:

This only affects new applications and as long as you are running MySQL v5.7.7 and higher you do not need to do anything.

Sadly, if you're running MariaDB you need to keep fixing this.

1 like
Sinnbeck's avatar

The issue is in regards to MySQL, not PHP :) But if i recall correct, XAMPP uses MariaDB. Correct me if I am wrong :)

Please or to participate in this conversation.