-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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 #20627
Comments
Yes, check the documentation. |
@themsaid thanks check out https://laravel.com/docs/master/migrations/#creating-indexes but if possible put some default values :) |
10.2 MariaDB is now stable, any reason for not upgrading to fix this issue @kalidasweb? |
I am confused .. is this fixed in current laravel versions or not? |
@amenk There is no 'bug', 'fix' per se. It's because the default length is different. Either upgrade your MySQL/MariaDB versions or add the |
I'm getting the same error in a Laravel project even after making various updates. I'm running the following versions on a local ampps server on Windows 10: In AppServiceProvider.php near the top I've added: And in function boot I've added: In config/database.php I've changed charset tp 'utf8',collation to 'utf8_general_ci', and engine to 'InnoDB ROW_FORMAT=DYNAMIC'. Using 1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes") I was wondering if the doctrine cache needed clearing but |
I'm getting the same error in a Laravel project even after making various updates. I'm running the following versions on a local xampp server on Windows 10: Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table the problem exists to the version 5.4 laravel why no one will change so that you do not have to change every time you create a new project? |
The exception that you pasted is not the same as the exception at issue here. |
Need at least Maria 10.2.2. I would think that any "fixes" that the framework could provide, so that this works even when using old database versions, would be a huge bc break dealing with migrations. |
Description:
Steps To Reproduce:
1.Create the new app
2.Set Env values
3.Run
php artisan make:auth
4.Run
php artisan migrate
5.Got Error
Steps To Fix:
1.Goto app/Providers/AppServiceProvider.php
2. Add
\Illuminate\Support\Facades\Schema::defaultStringLength(191);
in that boot methodis it really correct fix ?
The text was updated successfully, but these errors were encountered: