Jump to content

Prestashop 1.7.3 SQLSTATE[HY000] [2002] database cannot be established line 120


Recommended Posts

Hello; I need your help and support.

I follow the instruction for install Prestashop 1.7.3 by XAMPP.

and when I try to connect for the first time to admin, I had the next message.

Can you help me to fix this issue?

Tks a lot

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

Link to database cannot be established: SQLSTATE[HY000] [2002] No se puede establecer una conexi�n ya que el equipo de destino deneg� expresamente dicha conexi�n. 
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;

 

 

 

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...