Nette\Database\ConnectionException #HY000

SQLSTATE[HY000] [2002] Connection refused search►

Source file

File: .../nette/database/src/Database/DriverException.php:25

15: { 16: /** @var string */ 17: public $queryString; 18: 19: 20: /** 21: * @return static 22: */ 23: public static function from(\PDOException $src) 24: { 25: $e = new static($src->message, NULL, $src); 26: if (!$src->errorInfo && preg_match('#SQLSTATE\[(.*?)\] \[(.*?)\] (.*)#A', $src->message, $m)) { 27: $m[2] = (int) $m[2]; 28: $e->errorInfo = array_slice($m, 1); 29: $e->code = $m[1];

Call stack

  1. .../vendor/nette/database/src/Database/Connection.php:70 source  Nette\Database\DriverException::from(arguments)

    60: public function connect() 61: { 62: if ($this->pdo) { 63: return; 64: } 65: 66: try { 67: $this->pdo = new PDO($this->params[0], $this->params[1], $this->params[2], $this->options); 68: $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 69: } catch (PDOException $e) { 70: throw ConnectionException::from($e); 71: } 72: 73: $class = empty($this->options['driverClass']) 74: ? 'Nette\Database\Drivers\\' . ucfirst(str_replace('sql', 'Sql', $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME))) . 'Driver'
    $src
    
    
  2. .../vendor/nette/database/src/Database/Connection.php:115 source  Nette\Database\Connection->connect()

    105: public function getPdo() 106: { 107: $this->connect(); 108: return $this->pdo; 109: } 110: 111: 112: /** @return ISupplementalDriver */ 113: public function getSupplementalDriver() 114: { 115: $this->connect(); 116: return $this->driver; 117: } 118: 119:
  3. .../nette/database/src/Database/Table/SqlBuilder.php:97 source  Nette\Database\Connection->getSupplementalDriver()

    87: /** @var array */ 88: private $cacheTableList; 89: 90: /** @var array of expanding joins */ 91: private $expandingJoins = []; 92: 93: 94: public function __construct($tableName, Context $context) 95: { 96: $this->tableName = $tableName; 97: $this->driver = $context->getConnection()->getSupplementalDriver(); 98: $this->conventions = $context->getConventions(); 99: $this->structure = $context->getStructure(); 100: $tableNameParts = explode('.', $tableName); 101: $this->delimitedTable = implode('.', array_map([$this->driver, 'delimite'], $tableNameParts));
  4. .../nette/database/src/Database/Table/Selection.php:96 source  Nette\Database\Table\SqlBuilder->__construct(arguments)

    86: * @param Nette\Caching\IStorage|NULL 87: */ 88: public function __construct(Context $context, IConventions $conventions, $tableName, Nette\Caching\IStorage $cacheStorage = NULL) 89: { 90: $this->context = $context; 91: $this->conventions = $conventions; 92: $this->name = $tableName; 93: 94: $this->cache = $cacheStorage ? new Nette\Caching\Cache($cacheStorage, 'Nette.Database.' . md5($context->getConnection()->getDsn())) : NULL; 95: $this->primary = $conventions->getPrimary($tableName); 96: $this->sqlBuilder = new SqlBuilder($tableName, $context); 97: $this->refCache = &$this->getRefTable($refPath)->globalRefCache[$refPath]; 98: } 99: 100: