我正在尝试Cakephp 3.x
从本地计算机连接远程数据库服务器。
但它显示以下错误
错误:SQLSTATE[HY000] [2002] 没有到主机的路由
我的本地数据库配置app.php
看起来像 -
'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => '192.168.1.19',
/**
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
'port' => '3306',
'username' => 'remote_db_user',
'password' => 'my_password',
'database' => '********',
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,
],
/*Other configs*/
]
关于远程服务器:
ping 192.168.1.19
我的电脑上的这个 IP 没问题IP
此地址没有名称服务器
我该如何解决这个问题?