When I run CLI commands in magento 2.2 php bin/magento setup:upgrade
I'm getting following error.
[Zend_Db_Adapter_Exception]
SQLSTATE[HY000] [2002] Connection timed out
[PDOException]
SQLSTATE[HY000] [2002] Connection timed out
setup:upgrade [--keep-generated] [--magento-init-params="..."]
Also I get the same thing when I try to run: php bin/magento setup:static-content:deploy
Requested languages: en_US
Requested areas: frontend, adminhtml
Requested themes: Magento/blank, Magento/luma, BA/mypres, Magento/backend
[Zend_Db_Adapter_Exception]
SQLSTATE[HY000] [2002] Connection timed out
[PDOException]
SQLSTATE[HY000] [2002] Connection timed out
setup:static-content:deploy [-d|--dry-run] [--no-javascript] [--no-css] [--no-less] [--no-images] [--no-fonts] [--no-html] [--no-misc] [--no-html-minify] [-t|--theme[="..."]] [--exclude-theme[="..."]] [-l|--language[="..."]] [--exclude-language[="..."]] [-a|--area[="..."]] [--exclude-area[="..."]] [-j|--jobs[="..."]] [--symlink-locale] [languages1] ... [languagesN]
Hardly anything works with CLI..
I tried to run the upgrade with -vvv. This was the output.
php bin/magento setup:upgrade -vvv
[InvalidArgumentException]
There are no commands defined in the "setup" namespace.
Exception trace:
() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:501
Symfony\Component\Console\Application->findNamespace() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:535
Symfony\Component\Console\Application->find() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:192
Symfony\Component\Console\Application->doRun() at /home/timothy/Public/www/vendor/magento/framework/Console/Cli.php:96
Magento\Framework\Console\Cli->doRun() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /home/timothy/Public/www/bin/magento:23