Steven Ferrino

Technical SEO / PHP Developer

  • Home
  • SEO
  • Local Search
  • PHP
You are here: Home / PHP / Laravel 5.4: SQLSTATE[42000]: Password_resets – [Solution]

Laravel 5.4: SQLSTATE[42000]: Password_resets – [Solution]

April 4, 2017 by Steven Leave a Comment

I found that when doing a new install of Laravel 5.4 and using the files supplied in the /database/migrations/ folder, specifically “2014_10_12_1000000_create_password_resets_table.php”, I ran into the following error:

[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter tab
le `password_resets` add index `password_resets_email_index`(`email`))

[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Changing line 17 from:

$table->string('email')->index();

To:

$table->string('email');

Fixed the issue.

I’m assuming that the need for an Index on the email column is really not necessary since there shouldn’t be that many rows in this table to begin with.

Let me know if this fixed your issue.

Filed Under: PHP

Steven Ferrino

Recent Posts

  • Google Core March 2023 Not Just E-A-T
  • [Fix] – Jupiter Theme: /jupiter/dynamic-styles/global/header.php on line 346
  • Laravel 5.4: SQLSTATE[42000]: Password_resets – [Solution]
  • Restrict wp-login.php Access With Htaccess
  • Reading CSV Data and Ignoring NA’s

Blogroll

  • Microdata Generator

Profiles

  • LinkedIn
  • Twitter

Copyright © 2023 · Dynamik-Gen on Genesis Framework · WordPress · Log in