I am able to connect via terminal as
mysql -h **.**.*.** -u ******@******* –p
able to connect via php code
mysqli_real_connect($conn, $host, $username, $password, $db_name, 3306, NULL, MYSQLI_CLIENT_SSL);
but when connecting via laravel connection getting refused
below are the configurations I did in Laravel
in .env file
MYSQL_SSL=true
new folder created in application folder as ssl and downloaded DigiCertGlobalRootCA.pem file
in config/database.php
'mysql' => [
...
'sslmode' => env('DB_SSLMODE', 'prefer'),
'options' => (env('MYSQL_SSL') && extension_loaded('pdo_mysql')) ? [
PDO::MYSQL_ATTR_SSL_KEY => '/ssl/DigiCertGlobalRootCA.crt.pem',
] : []
],
Followed link : enter link description here
Error deatils
php artisan migrate
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] (SQL: select * from information_schema.tables where table_schema = sample_db and table_name = migrations and table_type = 'BASE TABLE')