0

I'm trying to follow the devdoc instructions for a CLI upgrade from 2.3.2 to 2.3.3 but I'm getting this Connection refused error partway through the process.

My app/etc/env.php looks like this...

    'db' => [
        'table_prefix' => '',
        'connection' => [
            'default' => [
                'host' => '127.0.0.1',
                'dbname' => 'my_database_name',
                'username' => 'my_database_user',
                'password' => 'my_database_password',
                'active' => '1'
            ]
        ]
    ],

I can connect using these credentials mysql -h 127.0.0.1 -u my_database_user -p my_database_name fine.

Running a bin/magento setup:upgrade gives me....

Cache cleared successfully
File system cleanup:
/var/www/html/magento2/generated/code/Amazon
/var/www/html/magento2/generated/code/Composer
/var/www/html/magento2/generated/code/Dotdigitalgroup
/var/www/html/magento2/generated/code/Ebizmarts
/var/www/html/magento2/generated/code/Infortis
/var/www/html/magento2/generated/code/MSP
/var/www/html/magento2/generated/code/Magento
/var/www/html/magento2/generated/code/Migration
/var/www/html/magento2/generated/code/Symfony
/var/www/html/magento2/generated/code/Temando
/var/www/html/magento2/generated/code/Yotpo
The directory '/var/www/html/magento2/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
SQLSTATE[HY000] [2002] Connection refused

I'm really confused by this and how to correct it.

The only other clue I have is that magento.cron.log has lines of the form...

In Abstract.php line 144:

  SQLSTATE[HY000] [2002] Connection refused


In Abstract.php line 128:

  SQLSTATE[HY000] [2002] Connection refused


queue:consumers:start [--max-messages MAX-MESSAGES] [--batch-size BATCH-SIZE] [--area-code AREA-CODE] [--single-thread] [--pid-file-path PID-FILE-PATH] [--] <consumer>

Any ideas?

New contributor
razorhead is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
0

Are you 100% sure mysql is running and testing the connection from the command line works?

mysql -u USERNAME -pPASSWORD -h HOSTNAMEORIP DATABASENAME

My 2.3.3 env.php db section looks like this

    'db' => [
    'table_prefix' => '',
    'connection' => [
        'default' => [
            'host' => 'host',
            'dbname' => 'dbname',
            'username' => 'user',
            'password' => 'pass',
            'model' => 'mysql4',
            'engine' => 'innodb',
            'initStatements' => 'SET NAMES utf8;',
            'active' => '1'
        ]
    ]
],
  • Yes, 100% sure it’s running and those credentials work. In fact, if my credentials in env.php are wrong, the upgrade job won’t even start (tried it). – razorhead Jan 14 at 22:59

Your Answer

razorhead is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.