Jump to content

My prestashop is down


boris

Recommended Posts

Hello,

Since 2 days i have this message when i try to access my back office :

[PrestaShopException]
Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused
at line 120 in file classes/db/DbPDO.php

115.     public function connect()
116.     {
117.         try {
118.             $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
119.         } catch (PDOException $e) {
120.             throw new PrestaShopException('Link to database cannot be established: '.$e->getMessage());
121.         }
122. 
123.         $this->link->exec('SET SESSION sql_mode = \'\'');
124. 
125.         return $this->link;



DbPDOCore->connect - [line 323 - classes/db/Db.php]
DbCore->__construct - [line 234 - classes/db/Db.php] - [4 Arguments]
DbCore::getInstance - [line 48 - config/alias.php]
pSQL - [line 339 - classes/shop/Shop.php] - [1 Arguments]
ShopCore::initialize - [line 117 - config/config.inc.php]
require - [line 43 - admin/index.php] - [1 Arguments]

I had two active domain but i only renewed 1 last week and I don't know if it's related.

Any suggestions to fix this ? 

Thanks you

Capture d’écran 2021-02-10 à 11.44.22.png

Link to comment
Share on other sites

Hi,

well, if your database was created on the other domain's hosting, which you've not renewed - could be the reason, as it seems that Prestashop cannot connect to the database.

You should go and ask the hosting support, as they know the best how your hosting and domains configured.

Maybe you should try to use the IP of the database server in the database configuration file : /app/config/parameters.php , variable : database_host

Also just for curiosity? 
Did you had a multistore configuration, and both domain were in a Multistore config?

Kind regards, Leo

Edited by Prestachamps (see edit history)
  • Like 1
Link to comment
Share on other sites

thanks for the reply, I'm not certain but I think it was multistore (Although I never used the second domain)

Il will try to change the IP, if it's not working I will contact my hosting service.

I will you know.

Thanks you

Link to comment
Share on other sites

thanks for the reply, I'm not certain but I think it was multistore (Although I never used the second domain)

Il will try to change the IP, if it's not working I will contact my hosting service.

I will you know.

Thanks you

-----------------

edit : seems like I have a local database (i don't know what is means) so when i go to /app/config/parameters.php, database_host it's from my domain provider.

Might need to check with them tomorrow, it's a small company I know close to my house.

I will let you know.

Link to comment
Share on other sites

  • 2 weeks later...

quick update : Still does not work, seems not tied to the domains.

As I understand the company responsible for the hosting of my site does not make security update on the server unless I pay them (which might be fair). As other hosting platform offer the same price WITH security update I will probably make a new website from scratch with another host provider.

Cheers

Link to comment
Share on other sites

Before I give up completely I found this thread :

It says :

On 9/24/2017 at 10:00 AM, selectshop.at said:

BTW natively "localhost" and "127.0.0.1" is the same thing. The problem is on your server configuration, i.e. server directives or firewall configuration are blocking one of both. So try both: 127.0.0.1 or localhost.

So I wen to /www.mysite.com/app/config and opened the parameters.php (attached picture)

786415045_Capturedecran2021-02-25a16_57_36.thumb.png.63b49da52e9b1ac743964c9ef3bd303e.png

The only 127.0.0.1 is for mailer_host

There is also not port  

Where should I changed the infos ? Can the error be corrected in PHPmyadmin ? Sorry if I sound like a noob i try to understand

 

Link to comment
Share on other sites

It 

On 2/25/2021 at 5:09 PM, boris said:

Before I give up completely I found this thread :

It says :

So I wen to /www.mysite.com/app/config and opened the parameters.php (attached picture)

786415045_Capturedecran2021-02-25a16_57_36.thumb.png.63b49da52e9b1ac743964c9ef3bd303e.png

The only 127.0.0.1 is for mailer_host

There is also not port  

Where should I changed the infos ? Can the error be corrected in PHPmyadmin ? Sorry if I sound like a noob i try to understand

 

It is obvious from the part you show ("sql.n") that your database is not on localhost/127.0.0.1. At least not in its present settings.

To me this seems a case where you should ask your hosting provider. It looks like they made some changes.

Link to comment
Share on other sites

23 hours ago, musicmaster said:

It 

It is obvious from the part you show ("sql.n") that your database is not on localhost/127.0.0.1. At least not in its present settings.

To me this seems a case where you should ask your hosting provider. It looks like they made some changes.

I tried both 127.0.0.1 and localhost and nothing changed so I reverted back to what is was previously.

My host provider ask me money to just look into this, It does not feel right as nothing have changed on my side.

Thanks

Link to comment
Share on other sites

1 hour ago, boris said:

I tried both 127.0.0.1 and localhost and nothing changed so I reverted back to what is was previously.

My host provider ask me money to just look into this, It does not feel right as nothing have changed on my side.

Thanks

Every hosting provider either has somewhere a webpage specifying how to connect to its database or sends you detailed instructions how to do so.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...