I'm working on a Laravel 5.8 project using Homestead. The project works fine with database port is set to 3306
but I can't run artisan commands. When I change database port to 33060
database stops working but artisan commands work. with port 3306
whe I run any artisan command I get this message
And when I switch to 33060
error disappears and can run artisan commands but database stops working
APP_DEBUG=true
APP_URL=http://127.0.0.1
APP_ENV=local
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33060
DB_DATABASE=forums
DB_USERNAME=homestead
DB_PASSWORD=secret
config/database.php
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],