修改laravel/config/database.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), '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' => '', 'prefix_indexes' => true, 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], |
从
1 2 |
'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', |
调整为
1 2 |
'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', |
删除出错但已经创建的数据表后,重新php artisan migrate
There are no comments yet