have you cleared config cache?
Keeping getting this error trying to connect to mysql managed service by digital ocean
SQLSTATE[HY000] [2002] (trying to connect via (null)) (Connection: mysql, SQL: select table_name as name, (data_length + index_length) as size, table_comment as comment, engine as engine, table_collation as collation from information_schema.tables where table_schema = 'defaultdb' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:829 825▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 826▕ ); 827▕ } 828▕ ➜ 829▕ throw new QueryException( 830▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 831▕ ); 832▕ } 833▕ }
+43 vendor frames
44 artisan:35 Illuminate\Foundation\Console\Kernel::handle()
this is my connect file database.php
'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), '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, 'ssl_mode' => env('SSL_MODE'), 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), // PDO::MYSQL_ATTR_INIT_COMMAND => 'SET SESSION sql_require_primary_key=0', ]) : [], ],
and i have all my .env variables set
Please or to participate in this conversation.