运行命令php artisan migrate
In Connection.php line 664:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
chema.tables where table_schema = homestead and table_name = migrations)
In Connector.php line 67:
SQLSTATE[HY000] [2002] Connection refused
My.env文件包含:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
我的database.php文件包含:
'mysql' => [
'driver' => 'mysql',
'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' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
任何想法有什么不对?我一直在网上寻求帮助,但到目前为止他们都没有。
答案 0 :(得分:0)
尝试替代,
我希望这能解决你的问题。