When running Laravel String migrations, I came across the error:
SQLSTATE [HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes. (SQL: alter table `users` add unique` users_email_unique` (`email`)) In Connection.php line 458: SQLSTATE [HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.
I saw the suggestion to add the code:
Schema::defaultStringLength (191);
In the file app / Providers / AppServiceProvider.php which would set the maximum string length to 191 characters, but that didn't solve me.
I have run the bank locally with Php my admin, and as this comment in the official repository, just inside Php my admin (or whichever way you prefer) change the global variables, leaving them with the following values:
- innodb_file_format = Barracuda
- innodb_large_prefix = 1
- innodb_default_row_format = dynamic
Alternatively, use a more current version of MySQL.
Leave a Reply