Jump to content
Roxtion

Link to database cannot be established:SQLSTATE[HY000] [2005]

Recommended Posts

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

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

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

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

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

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

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

What solved it for me is to delete the files in /prestashop/var/cache/prod

thanks

  • Like 1

Share this post


Link to post
Share on other sites
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

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

Important Information

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