'connections' => [ 'mysql'=> [ // 数据库类型 'type' => env('database.type', 'mysql'), // 服务器地址 'hostname' => env('database.hostname', '127.0.0.1'), // 数据库名 'database' => env('database.database', 'test_xyh_com'), // 用户名 'username' => env('database.username', 'xyh'), // 密码 'password' => env('database.password', '123456'), // 端口 'hostport' => env('database.hostport', '3306'), // 数据库连接参数 'params' => [], // 数据库编码默认采用utf8 'charset' => env('database.charset', 'utf8'), // 数据库表前缀 'prefix' => env('database.prefix', ''),
There seems to be no problem with the configuration. I can’t solve it even if I search it on Baidu
.env is like this. I tried it a few more times and it works. Thank you teacher
First check whether .env is enabled, this just defines the default options for you