The connection between prestashop and database lost

Keywords: PrestaShop - AWS - Technical issue - Other
bnsupport ID: 7b3a9fe9-77f5-5fc3-a63a-31ce8df8eba8
Description:
i cant access my app
i had a problem when changing database host and domain name
the message was Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused
at line 127 in file classes/db/DbPDO.php

  1. public function connect()
    
  2. {
    
  3.     try {
    
  4.         $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
    
  5.     } catch (PDOException $e) {
    
  6.         throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
    
  7.     }
    
  8.     $this->link->exec('SET SESSION sql_mode = \'\'');
    
  9.     return $this->link;
    

DbPDOCore->connect - [line 330 - classes/db/Db.php]
DbCore->__construct - [line 241 - classes/db/Db.php] - [4 Arguments]
DbCore::getInstance - [line 48 - config/alias.php]
pSQL - [line 340 - classes/shop/Shop.php] - [1 Arguments]
ShopCore::initialize - [line 119 - config/config.inc.php]
require - [line 27 - index.php] - [1 Arguments]
then i returned it to localhost as default but the connection between prestashop and database lost but still throw ssh
i made some edit to parameters.php and docker composer.yml at first after that i restored it as default
then erorr 500
some folders affected like config and its files
files like parameters.php . autoload.php
im in big problem

many thank

Hi @perfect.tanta,

Which modifications did you perform in the parameters.php file? According to the bnsupport bundle, it is empty

apps/prestashop/htdocs/app:
total 32
drwxr-xr-x 4 bitnami bitnami 4096 Apr 11 07:21 .
drwxrwxrwx 37 bitnami daemon 4096 Apr 11 01:28 …
-rw-r–r-- 1 bitnami bitnami 1125 Apr 9 09:41 AppCache.php
-rw-r–r-- 1 bitnami bitnami 7322 Feb 3 12:58 AppKernel.php
drwxrwxr-x 3 bitnami bitnami 4096 Apr 11 07:11 config
-rw-r–r-- 1 bitnami bitnami 104 Feb 3 12:58 .htaccess
-rw-r–r-- 1 bitnami bitnami 0 Apr 11 07:41 parameters.php
drwxrwxrwx 5 bitnami bitnami 4096 Feb 3 12:58 Resources

Did you remove/added/edited any other file?

hello
the last time for website good performance was 7 april
i was trying to edit host domain to refer to tantastore.com instead of instance ip
but i edited in the database host
after that i restored database host to localhost as default but still not connected to database

i wish you could help me

many thanks

Hi @perfect.tanta,

I’m afraid I don’t know if you have done any other modification to the file that is preventing the application to work properly. Can you ask in the Prestashop official forums?

https://www.prestashop.com/forums/

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.