jeudi 28 avril 2016

laravel 5.1 - SQLSTATE[HY000] [2002] A connection attempt failed.. - when attempt to connect from Local to remote server

env file:

APP_ENV=local
APP_DEBUG=true
APP_KEY= ...........

DB_HOST=srv3.linuxisrael.co.il
DB_DATABASE= name_of_my_database
DB_USERNAME=moti_winkler
DB_PASSWORD=1234567890

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

Routes.php :

use App\User;

Route::get('/', function(){
    User::create(['first_name' => 'moti']);
    return view('welcome');
});

The error i get :

PDOException in Connector.php line 55:

SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

My problem is that:

I'm trying to connect from my computer - to my remote MySQL server

And I don't understand why it doesn't work ?

What should I do to connect ?

What am I missing ?

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire