Jump to content

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

Recommended Posts


I am getting the below error after doing an upgrade when trying to log in to the BO. 

The front end shows a 500 error.

Initially I did the upgrade using 1click upgrade and that broke the site with a 500 error. I then tried to do an upgrade using Plesk and recieved the below. 

Can anyone please help?  



Link to database cannot be established:SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
at line 102 in file classes/db/DbPDO.php

97.     public function connect()
98.     {
99.         try {
100.             $this->link = $this->_getPDO($this->server, $this->user, $this->password, $this->database, 5);
101.         } catch (PDOException $e) {
102.             throw new PrestaShopException('Link to database cannot be established:'.$e->getMessage());
103.         }
105.         // UTF-8 support
106.         if ($this->link->exec('SET NAMES \'utf8\'') === false) {
107.             throw new PrestaShopException('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.');

Share this post

Link to post
Share on other sites


Kindly verify the DB details in app/config/parameters.php file. 

Also, delete the all the folders from app/cache (Basically to delete the cache file)


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More