Skip to content
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

Sql Error #18

Open
farmaworld opened this issue Jan 11, 2018 · 3 comments
Open

Sql Error #18

farmaworld opened this issue Jan 11, 2018 · 3 comments

Comments

@farmaworld
Copy link

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

@bestmomo
Copy link
Owner

Check your MySQL version, look at that.

@jkoech
Copy link

jkoech commented Feb 17, 2018

Edit AppServiceProvider.php and add Schema::defaultStringLength(191); to the boot method as below:

public function boot()
{
    Schema::defaultStringLength(191);
}

@sims34
Copy link

sims34 commented Nov 23, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants