cachet: "php artisan migrate" error ... access violation: 1071 Specified key was too long
Trying to install a new instance on CentOS 7.2
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table
subscribers add unique subscribers_email_unique(email))
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
The only tables created in Mysql are:
show tables; ±-------------------+ | Tables_in_cachet | ±-------------------+ | component_groups | | components | | incident_templates | | incidents | | metric_points | | metrics | | migrations | | settings | | subscribers | ±-------------------+
And seems that some tables are missing (users, …)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (8 by maintainers)
Hi there, Try this
Locate config/database.php from the root folder
If you have something like this, ‘charset’ => ‘utf8mb4’, ‘collation’ => ‘utf8mb4_unicode_ci’,
then change to ‘charset’ => ‘utf8’, ‘collation’ => ‘utf8_unicode_ci’,
save and try " php artisan migrate " I think this could solve the problem
Thanks