magento2.2 – When I run the cli commands in magento 2.2

php bin / magento setup: update <<< I receive this error below ..

[Zend_Db_Adapter_Exception]                  
                    
                    
                    
  SQLSTATE[HY000] [2002]    The connection has expired  

  [PDOException]                               
  SQLSTATE[HY000] [2002]    The connection has expired

configuration: 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 topics: Magento / blank, Magento / Luma, BA / mypres, Magento / backend



  [Zend_Db_Adapter_Exception]                  
  SQLSTATE[HY000] [2002]    The connection has expired  

  [PDOException]                               
  SQLSTATE[HY000] [2002]    The connection has expired



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]

Almost nothing works with CLI ..