“SQLState [42000]: Kesalahan sintaks atau pelanggaran akses: 1071” Kode Jawaban

PDOException ::( "SQLState [42000]: Kesalahan Sintaks atau Pelanggaran Akses: 1071 Kunci yang ditentukan terlalu panjang; Panjang Kunci Maks adalah 1000 byte") Laravel 8

// Update your /app/Providers/AppServiceProvider.php to contain:

use Illuminate\Support\Facades\Schema;

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

//ON this error 
//   PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists")
// After run ->  php artisan migrate:fresh  <- ! Note this will reset all tables in db
Jaskaran

Kesalahan migasi mighvel

use Illuminate\Support\Facades\Schema;

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

SQLState [42000]: Kesalahan sintaks atau pelanggaran akses: 1071

use Illuminate\Support\Facades\Schema;

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
    Schema::defaultStringLength(191);
}
Dev

Perbaiki kesalahan mysql 1071 (42000)

# ERROR 1071 (42000): OR ANY ABOUT Specified key was too long; max key length is 767 bytes
# =============================================================================

# This error impacts MYSQL and MariaDB
# The commands that you will need to run to correct the error are:

SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_large_prefix=on;
sumer5020

Jawaban yang mirip dengan “SQLState [42000]: Kesalahan sintaks atau pelanggaran akses: 1071”

Pertanyaan yang mirip dengan “SQLState [42000]: Kesalahan sintaks atau pelanggaran akses: 1071”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya