Lambu Posted March 1, 2021 Share Posted March 1, 2021 Hello, I very often encounter the following Error 500 on my website since a few days (main page and backoffice) : [PrestaShopException] Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused at line 136 in file classes/db/DbPDO.php 131. public function connect() 132. { 133. try { 134. $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5); 135. } catch (PDOException $e) {136. throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage()); 137. } 138. 139. $this->link->exec('SET SESSION sql_mode = \'\''); 140. 141. return $this->link; Does anyone know why and how I could fix this? Thank you very much in advance!! Link to comment Share on other sites More sharing options...
Lambu Posted March 8, 2021 Author Share Posted March 8, 2021 up Link to comment Share on other sites More sharing options...
JBW Posted March 9, 2021 Share Posted March 9, 2021 As you can see the database connection does not work. If you hav not changed anything on the database (password for example) you should ask your hosting provided if the db is up and running Link to comment Share on other sites More sharing options...
pinwheel Posted March 9, 2021 Share Posted March 9, 2021 JBW is right. Most probably your MYSQL server is going down. This can happen a lot on shared server environments. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now