2016-06-21 120 views
0

我有离线应用(安装在本地主机),但在数据库服务器在线..因为我要让像同步...laravel连接到在线数据库

我试图把我像为database.php这

 'mysqlserver' => array(
      'host'  => '103.38.103.142', 
      'port'  => '212', 
      'driver' => 'mysql', 
      'database' => 'lgspsb', 
      'username' => 'xxxxxxx', 
      'password' => 'xxxxxxx', 
      'charset' => 'utf8', 
      'collation' => 'utf8_unicode_ci', 
      'prefix' => '', 
     ), 

但错误是这样的...

SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 0 

我怎么解决不了?先谢谢了......对不起我的英文不好

+0

你确定端口是:212?我猜正常的mysql端口:3306 – num8er

+0

是的,我确定... @ num8er – Megandi

+0

检查你远程数据库监听公共网络接口,并有用户授予你进入。 – num8er

回答