我正在尝试将我的项目 laravel 连接到外部服务器,当它在本地主机中时它连接得很好,但是当我尝试将它托管到服务器时,它显示了这个错误
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `cdr`
where `dst` in (0, 0, 0))
这是我的 database.php 和 .env
数据库.php
'mysqlExtern' => [
'driver' => 'mysql',
'host' => env('DB_HOST_EXT', '187.164.77.77'),
'port' => env('DB_PORT_EXT', '3306'),
'database' => env('DB_DATABASE_EXT', 'testDb'),
'username' => env('DB_USERNAME_EXT', 'xxxx'),
'password' => env('DB_PASSWORD_EXT', 'xxxxx'),
],
.env
DB_CONNECTION=mysqlExtern
DB_HOST_EXT=187.164.77.77
DB_PORT_EXT=3306
DB_DATABASE_EXT=testDb
DB_USERNAME_EXT=coga
DB_PASSWORD_EXT=RTgh457
守着一只汪