2016-06-21 118 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

回答