1

i am trying to connect to a remote database using the following code:

public $default = array(
    'datasource' => 'Database/Mysql',
    'persistent' => false,
    'host' => '***.unoeuro-****.com',
    'login' => '*********',
    'password' => '**************',
    'database' => '************',
    'prefix' => '',
);

Now when i try this i get the following error message:

    2013-09-13 16:10:55 Error: [MissingConnectionException] Database connection "Mysql" is missing, or could not be created.
Exception Attributes: array (
  'class' => 'Mysql',
  'message' => 'SQLSTATE[HY000] [2005] Unknown MySQL server host \'****.unoeuro-server.com\' (2)',
  'enabled' => true,
)

Can anyone tell me why this is happening?

4

2 回答 2

2

由于您的数据库服务器是外部资源,因此请确保您没有防火墙阻止来自应用程序的请求。

于 2013-09-13T14:16:21.543 回答
0

如果您从本地主机连接到远程数据库,则需要从您尝试连接的服务器启用远程 MySQL。它的安全功能

于 2013-09-13T14:51:17.020 回答