gpt4 book ai didi

php - 航海者 php artisan 航海者 :install --with-dummy error

转载 作者:行者123 更新时间:2023-11-29 10:49:28 26 4
gpt4 key购买 nike

[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_foreign_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

AppServiceProvider.php 这种方式不起作用我无法修复此错误有什么方法可以修复它吗?

use Illuminate\Support\Facades\Schema;

public function boot()
{
Schema::`defaultStringLength`(191);
}

最佳答案

当我尝试安装 voyager 时,就发生了这种情况。经过一番挖掘后,我发现这两个答案有效。

解决方案01

* /config/database.php *

'mysql' => [
...,
...,
'engine' => 'InnoDB',
]

解决方案02
编辑config文件夹中的database.php文件。(与上面答案中的相同文件)只需编辑,

'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',

'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',

我从Laravel Migration Error: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes找到这些问题答案。因此,所有功劳都应归功于@dexterb 和@Koushik Das

关于php - 航海者 php artisan 航海者 :install --with-dummy error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43994155/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com