laravel5-5-example
laravel5-5-example copied to clipboard
Sql Error
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table password_resets
add inde
x password_resets_email_index
(email
))
In Connection.php line 458:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
Check your MySQL version, look at that.
Edit AppServiceProvider.php and add Schema::defaultStringLength(191);
to the boot method as below:
public function boot()
{
Schema::defaultStringLength(191);
}
PHP : 7.2 LARAVEL : 5.7
An other solution
In the folder config/database.php into mysql
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
remove mb4 for get this :
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
Delete all tables into your mysql interface (such as phpMyAdmin) for get no conflict.
And run php artisan migrate --seed
again
It's work for me.
Good Luck