@lutkabe check your config/database.php https://github.com/laravel/laravel/blob/8.x/config/database.php#L18
There might be a hardcoded credentials in that file.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone,
In my project the php artisan migrate is supposed to target a mysql database but it throws the following exception: PDOException::("could not find driver"). I used Tinker and all env settings are correct except the env('DATABASE_URL) which is pointing to a pgsql connection string that I do not know where it comes from. I tried the php artisan cache:clear and php artisan config:clear commands but no luck. Would someone please let me know how to find and get rid of the unwanted mysterious pgsql connection string above? Thanks!
I just commented out the 'url' => env('DATABASE_URL') in the database.php and it worked like a charm. Here is my updated 'mysql' config:
'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,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
Thanks everyone!
Please or to participate in this conversation.