PRESTASHOP Cannot connect to db: Link to database cannot be established: SQLSTATE[HY000] [1045]

3.5k Views Asked by At

I've created a PrestaShop 1.7.5 app on my server and everything works there.

I was trying to create my dev version, so I copied all files from server to my localhost.

I run my app using lampp.

Dev version doesn't work, because I got:

    Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user 'srv38468_pr1'@'localhost' (using password: YES)
at line 136 in file classes/db/DbPDO.php

I checked app/config/parameters.php:

    'database_host' => 'localhost',
'database_port' => '',
'database_name' => 'srv38468_pr1',
'database_user' => 'srv38468_pr1',
'database_password' => '****************',
'database_prefix' => 'pr_',
'database_engine' => 'InnoDB',

and this is a db's config from my server:

enter image description here

I see this error is very popular but I've checked all solutions and nothing works.

Does anyone have any ideas, how I can solve it?

1

There are 1 best solutions below

0
gennaris On

Double check db credentials, as error states clearly that they are wrong.

If you are sure they are correct, you might have old "production" cache that can lead to a non reachable db.

I would suggest you to clear your /var/cache/* folder and check back afterwards.