Php artisan queue:listen => SQLSTATE[HY000] [2002] Connection refused

Hi,

I have recently upgraded from a bug version to the version 5.3.66.

It was an ugly upgrade process and I had to manually import many of the tables, one by one because the database schema was different from my previous installation version. I am only saying it because it may be a clue of my current problem.

My new installation works beautifully, when the QUEUE_CONNECITON in .env is set to sync. Once I change to database it does not send any email.

I have tried to listen tot he queue and this is what I get.

root@billing .../www/ninja# sudo -u www-data php artisan queue:listen

In Connection.php line 712:

  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
  chema.tables where table_schema = ninja and table_name = accounts and table
  _type = 'BASE TABLE')


In Connector.php line 70:

  SQLSTATE[HY000] [2002] Connection refused



In Connection.php line 712:

  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
  chema.tables where table_schema = ninja and table_name = accounts and table
  _type = 'BASE TABLE')


In Connector.php line 70:

  SQLSTATE[HY000] [2002] Connection refused



In Connection.php line 712:

  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
  chema.tables where table_schema = ninja and table_name = accounts and table
  _type = 'BASE TABLE')


In Connector.php line 70:

  SQLSTATE[HY000] [2002] Connection refused
....(repeating)

I would love to solve this problem. Would you know what is wrong?

Hi,

@david any ideas?

1 Like

does it help to run either

php artisan config:clear

or

php artisan optimize