Roxtion Posted September 15, 2017 Posted September 15, 2017 Hi, I cannot access my site www.ttemarket.com getting the following message [PrestaShopException]Link to database cannot be established:SQLSTATE[HY000] [2005] Unknown MySQL server host '_DB_SERVER_' (2)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 support106. 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 319 - classes/db/Db.php] DbCore->__construct - [line 240 - classes/db/Db.php] - [4 Arguments] DbCore::getInstance - [line 66 - config/alias.php] pSQL - [line 329 - classes/shop/Shop.php] - [1 Arguments] ShopCore::initialize - [line 114 - config/config.inc.php] require - [line 36 - admin/index.php] - [1 Arguments] Share this post Link to post Share on other sites More sharing options...
bellini13 Posted September 15, 2017 Posted September 15, 2017 apparently you have the wrong database hostname configured Share this post Link to post Share on other sites More sharing options...
Roxtion Posted September 15, 2017 Posted September 15, 2017 apparently you have the wrong database hostname configured I don't understand This is what I had working all the time The Tech at godaddy use these credentials to login to the database and it worked but the site still down <?php return array ( 'parameters' => array ( 'database_host' => '127.0.0.1', 'database_port' => '3306', 'database_name' => 'sp_emarket', 'database_user' => 'sp_emarket', 'database_password' => 'xxxxxxxxxxxxx', 'database_prefix' => 'ps_', 'database_engine' => 'InnoDB', Share this post Link to post Share on other sites More sharing options...
Roxtion Posted September 15, 2017 Posted September 15, 2017 My final option was to do a restore from backup I hope that problem could be resolved though Share this post Link to post Share on other sites More sharing options...
Roxtion Posted September 16, 2017 Posted September 16, 2017 Still having problems now getting this error on Products page Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'sp_emarket'@'localhost' (using password: YES)' in /home/tteadmin/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43 Stack trace: #0 /home/tteadmin/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=127....', 'sp_emarket', Share this post Link to post Share on other sites More sharing options...
selectshop.at Posted September 16, 2017 Posted September 16, 2017 Seems the pdo modul on your server is not working properly. You should ask for support of your provider in this case. Share this post Link to post Share on other sites More sharing options...
Roxtion Posted September 16, 2017 Posted September 16, 2017 Unfortunately I am back to square on this morning with the site down again , can't run a business with this amount of instability I have used wordpress for years never encountered anything like this even the Technicians at Godaddy can't figure it out and adised me to hire a Prestashop expert. I have wasted enough time and money on this site and will now be considering going with Wordpress.Thanks Share this post Link to post Share on other sites More sharing options...
Moshhegh.Faghdan Posted July 14, 2018 Posted July 14, 2018 On 9/16/2017 at 5:16 PM, Roxtion said: Unfortunately I am back to square on this morning with the site down again , can't run a business with this amount of instability I have used wordpress for years never encountered anything like this even the Technicians at Godaddy can't figure it out and adised me to hire a Prestashop expert. I have wasted enough time and money on this site and will now be considering going with Wordpress.Thanks yes i have same problem and it take 1 month of my time and not solved ,prestashop is worst CMS that i use i plan to come back to WP/OpenCart Share this post Link to post Share on other sites More sharing options...
neich78 Posted October 10, 2018 Posted October 10, 2018 Have the same problem with the updato to 1.7.3.2. This is a nightmare, 3 days trying to solve several problems of the update and clients don't selling: Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'mymycollec'@'vxadc-36.srv.cat' (using password: YES) in /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43 Stack trace: #0 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=46.1...', 'mymycollec', '1lY0tjNj', Array) #1 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(44): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=46.1...', 'mymycollec', '1lY0tjNj', Array) #2 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'mymycollec', '1lY0tjNj', Array) #3 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(942): Doctrine\DBAL\Connection->connect() #4 /usr/home/mycollect.es/web/src/PrestaShopBundle/Kernel/ModuleRepository.php(59): Doctrine\DBAL\Connection->quer in /usr/home/mycollect.es/web/vendor/twig/twig/lib/Twig/Loader/Chain.php on line 129 Share this post Link to post Share on other sites More sharing options...
bellini13 Posted October 10, 2018 Posted October 10, 2018 14 minutes ago, neich78 said: Have the same problem with the updato to 1.7.3.2. This is a nightmare, 3 days trying to solve several problems of the update and clients don't selling: Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'mymycollec'@'vxadc-36.srv.cat' (using password: YES) in /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43 Stack trace: #0 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=46.1...', 'mymycollec', '1lY0tjNj', Array) #1 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(44): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=46.1...', 'mymycollec', '1lY0tjNj', Array) #2 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'mymycollec', '1lY0tjNj', Array) #3 /usr/home/mycollect.es/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(942): Doctrine\DBAL\Connection->connect() #4 /usr/home/mycollect.es/web/src/PrestaShopBundle/Kernel/ModuleRepository.php(59): Doctrine\DBAL\Connection->quer in /usr/home/mycollect.es/web/vendor/twig/twig/lib/Twig/Loader/Chain.php on line 129 You should contact your hosting provider for support. This is not a prestashop issue Share this post Link to post Share on other sites More sharing options...
Featured Comment Henrik Posted August 8, 2019 Posted August 8, 2019 What solved it for me is to delete the files in /prestashop/var/cache/prod thanks 2 Share this post Link to post Share on other sites More sharing options...
Pish_Peter Posted September 19, 2019 Posted September 19, 2019 Check your database credentials on Quote /app/config/parameters.php Share this post Link to post Share on other sites More sharing options...
sebastiano.riva Posted December 3, 2019 Posted December 3, 2019 On 8/8/2019 at 4:15 AM, Henrik said: What solved it for me is to delete the files in /prestashop/var/cache/prod thanks thanks! Its work! Share this post Link to post Share on other sites More sharing options...
highab Posted October 27, 2020 Posted October 27, 2020 I had this problem today. The DB check was fine. The site installed fine. So I'd entered the right db credentials but I had blank pages for both shop and admin. Apparently a character in my password was repeated in the /app/config/parameters.php file for some reason. I've sorted that and now I see something on both front and back ends. Share this post Link to post Share on other sites More sharing options...
prus Posted November 1, 2020 Posted November 1, 2020 i had this problem when i run out of free disk space on server Share this post Link to post Share on other sites More sharing options...
boris Posted February 7, 2021 Posted February 7, 2021 (edited) Hello, I'm having the same issue, 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 tried to follow the step to access /prestashop/var/cache/prod but it seems my var directory is missing for some reason. When i got to /app/config/parameters.php i can see my password and there seems to be no error (no repetition) Also, I'm not a specialist and I might have missed something. Could it be related to the domain ? I had 2 active domains and i renewed only one last week. I'm curious if this is a coincidence or if it's the reason my site is down. Thanks a lot Edited February 7, 2021 by boris (see edit history) Share this post Link to post Share on other sites More sharing options...
Mehrshad Zakerian Posted December 17, 2022 Posted December 17, 2022 On 8/8/2019 at 6:45 AM, Henrik said: What solved it for me is to delete the files in /prestashop/var/cache/prod thanks This worked. As I saw others have same issue and they could solve their problem with this solution, I highlighted your response as (Recommended). P.S: If the debug mode is ON you may need to remove prod & dev folder from var/cache. Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Posted by Henrik ,
This solution works
Recommended by Mehrshad Zakerian
2 reactions
Go to this post
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