Skip to content

Illuminate\Database\QueryException ( Specified key was too long ) #44

@mahdirashidi

Description

@mahdirashidi

php artisan world:init
Execute migrate first, migrating...
Migrating: 2017_04_08_163453_create_world_cities_locale_table
Migrated: 2017_04_08_163453_create_world_cities_locale_table (80.40ms)
Migrating: 2017_04_08_163453_create_world_cities_table

Illuminate\Database\QueryException

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table world_cities add index uniq _city(country_id, division_id, name))

at vendor\laravel\framework\src\Illuminate\Database\Connection.php:678
674▕ // If an exception occurs when attempting to run a query, we'll format the error
675▕ // message to include the bindings with SQL, which will make this exception a
676▕ // lot more helpful to the developer instead of just the database's errors.
677▕ catch (Exception $e) {
➜ 678▕ throw new QueryException(
679▕ $query, $this->prepareBindings($bindings), $e
680▕ );
681▕ }
682▕

  1. vendor\laravel\framework\src\Illuminate\Database\Connection.php:471
    PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes")

  2. vendor\laravel\framework\src\Illuminate\Database\Connection.php:471
    PDOStatement::execute()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions