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

Created on 21 Apr 2017  路  4Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4
  • Voyager Version: 0.11.9
  • PHP Version: 5.6
  • Database Driver & Version: mysql

Description:

Receiving the following errors in console when attempting to install Voyager:

[IlluminateDatabaseQueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table translations add unique translations_table_name_column_name_foreign_key_locale_unique(table_name, column_name, forei gn_key, locale))

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

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

Steps To Reproduce:

php artisan voyager:install

I have also tried adding Schema::defaultStringLength(191); to AppServiceProvider::boot(), which did not correct the issue.

Most helpful comment

Scratch that, all you have to do is set the mysql engine to InnoDB ROW_FORMAT=DYNAMIC

All 4 comments

This is the only solution that worked: https://github.com/the-control-group/voyager/issues/901#issuecomment-291470960

Scratch that, all you have to do is set the mysql engine to InnoDB ROW_FORMAT=DYNAMIC

After adding Schema::defaultStringLength(191); to AppServiceProvider::boot(), You need to change
'engine' => 'InnoDB', in config/database.php in mysql.

It is working for me !

Please don't common on very old closed issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rayqiri picture rayqiri  路  3Comments

craigb88 picture craigb88  路  3Comments

abacram picture abacram  路  3Comments

vaggelis2018 picture vaggelis2018  路  3Comments

IvanBohonosiuk picture IvanBohonosiuk  路  4Comments