voyager: laravel 5.4 install error
- Laravel Version: 5.4.*
- Voyager Version: 0.11.5
- PHP Version: 7.0.1
- Database Driver & Version: mysql 5.5
Description:
AppServiceProvider is add Schema::defaultStringLength(191);
Steps To Reproduce:
install error
λ php artisan voyager:install
Publishing the Voyager assets, database, and config files
Copied Directory [\vendor\tcg\voyager\publishable\assets] To [\public\vendor\tcg\voyager\assets]
Copied Directory [\vendor\tcg\voyager\publishable\database\migrations] To [\database\migrations]
Copied Directory [\vendor\tcg\voyager\publishable\database\seeds] To [\database\seeds]
Copied Directory [\vendor\tcg\voyager\publishable\demo_content] To [\storage\app\public]
Publishing complete.
Publishing complete.
Migrating the database tables into your application
Migration table created successfully.
[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 `translations` add unique `translations_table_name_column_name_fore
ign_key_locale_unique`(`table_name`, `column_name`, `foreign_key`, `locale`))
[Doctrine\DBAL\Driver\PDOException]
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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 15 (3 by maintainers)
If any body facing same problem, Please follow the below steps to fix the issue:
1. Update the “config/database.php” for ‘mysql’
with
++++++++++++++++++++++++++++++++++++++++++++
2. Update the “app/Providers/AppServiceProvider.php” with
++++++++++++++++++++++++++++++++++++++++++++
3. Execute Command:
Now, everything works! 😃
@vanloc0301
DYNAMIC and COMPRESSED Row Formats:
UTF8MB4:
More : MySQL reference
@zanjs I have same issues like you.
I resolved my problem, from @marktopper in Slack:
Great explain from @marktopper 👍
@neerajsinghsonu Can you explain why using
'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',?Have only some people meet this issues?
Thanks.
I’ve done following to get rid of the issue-
Drop the tables in the database [every one, including the migration table]
After some searching I found below solution and want to share it with you 1- set default string size in “app/Providers/AppServiceProvider.php” by adding \Schema::defaultStringLength(191); boot method
Schema::defaultStringLength(191);2- change charset and engine in “config/database.php” by replacing
'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => true, 'engine' => null, ],To'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => true, 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC', ],