@will83 Does your application have a proper connection with these env credentials?
IF SO, try this:
php artisan config:clear
php artisan cache:clear
php artisan queue:restart
php artisan config:cache
My failed jobs driver seems to be using an incorrect database login and I cannot figure out how to change it. This issue seems to have started after I upgraded to Laravel 11 from Laravel 10, but I can't be sure if that is the cause.
The error I receive is as follows:
"Access denied for user 'xxx'@'localhost' (using password: YES) (Connection: mysql, SQL: insert into `failed_jobs` (`uuid`, `connection`, `queue`, `payload`, `exception`, `failed_at`)"
"xxx" is the database name and user of my staging environment. It is not referenced in any of the files in my production environment.
In my .env file, I define "DB_DATABASE" and "DB_USER" as "yyy". These are the correct settings. I have defined "DB_CONNECTION" as mysql. The failed_jobs table exists and has all the fields.
In config/queue, I have defined the failed driver as follows:
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
],
In config/database I have the default mysql configuration:
'mysql' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_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'),
]) : [],
I have reset all cache using "php artisan cache:clear", I have restarted redis, and I have restarted the queues. Nothing seems to do the trick. Does anybody have any ideas?
Please or to participate in this conversation.