Jump to content

Link to database cannot be established:SQLSTATE[HY000] [2002] Connection refused


Recommended Posts

hello there, i've just set up prestashop on my linux server but i had the following problem when trying to change the localhost to domain everytime i connect to the domain i get this error (i activated dev_mode):

[PrestaShopException]

Link to database cannot be established:SQLSTATE[HY000] [2002] Connection refused
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.         }
104. 
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.');

    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 120 - config/config.inc.php]
    require - [line 27 - index.php] - [1 Arguments]

believe me when i say that i tried everything to fix it, this is my parameters.php

<?php return array (
  'parameters' => 
  array (
    'database_host' => '192.168.1.55',
    'database_port' => '',
    'database_name' => 'OneTradeDB',
    'database_user' => 'root',
    'database_password' => '****',
    'database_prefix' => 'OT_',

 

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