Jump to content

[PrestaShopException] Link to database cannot be established: SQLSTATE[HY000] [1045]


vimal

Recommended Posts

Hi,,

Please help me..

i successfully upload my prestashop 1.7 from local to remote Linux server , also upload the database to a new named database. after that i edit the parameters "parameters.php", but there is one error as bellow

 

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

 

please help me to solve this issue as early as possible, i am running out of time now. 

image.thumb.png.84d4cbc9146aec7cf65f6fc86d26133d.png

Link to comment
Share on other sites

Hi,

Are you able to login into Database server using the same credentials which you have mentioned in the parameters.php file?

Apart from, Can you please try after replacing DB host i.e. 198.15.115.235 to localhost? (Depends upon hosting).

Also, delete the cache from the folder i.e. app/cache (All folders inside the cache folder) & check again.

 

 

  • Thanks 1
Link to comment
Share on other sites

this is my parameters file

 

<?php return array (
  'parameters' => 
  array (
    'database_host' => '198.15.115.235',
    'database_port' => '3306',
    'database_name' => 'hostinga_awawdeh',
    'database_user' => 'hostinga_admin',
    'database_password' => '***************',
    'database_prefix' => 'ps_',
    'database_engine' => 'InnoDB',
    'mailer_transport' => 'smtp',
    'mailer_host' => '198.15.115.235',
    'mailer_user' => NULL,
    'mailer_password' => NULL,
    'secret' => '7NBAAvK3Arstsk3S1sKNr4RwAJygNJ40ImeR91Uu5ITrE2EKFPQGFu71',
    'ps_caching' => 'CacheMemcache',
    'ps_cache_enable' => false,
    'ps_creation_date' => '2018-05-12',
    'locale' => 'en-US',
    'cookie_key' => 'ghG0prkkydpUkuIom3ckK0pJGtgzHJwgyWT9FQiqrrOm9H2oMX5drKWg',
    'cookie_iv' => 'FsoiZEDT',
    'new_cookie_key' => 'def000002a1b9f33e7a60be29e1052234bc519c2788983ff9f3deaa9d36125364f2b54d6a7acb6bd0006df9869ccc3777cf8b7606b571fa4ba8b5a2996e0dd2cece068c8',
  ),
);

?>

 

this is my php myadmin window 

image.thumb.png.6ba42d59e64ec6d9fcd41caaa0600d30.png

Edited by vimal (see edit history)
Link to comment
Share on other sites

Hi,

I tried to access the Site from the URL i.e. http://98.15.115.235/awawdeh but it's not accessible but while I tried to access your using the URL i.e. http://hosting.redantonline.com/awawdeh/en/ Its working fine.

Kindly check.

 

To access the site using the IP, you need to contact the hosting provider (It might be shared IP & you will not be able to access the site using the IP). 

 

 

 

Link to comment
Share on other sites

  • 2 years later...

Hi there

i too are having this problem, my host said they checked and the error is not on their side.

I have 1800 products on my site and if i am not able to repair this error, it will take me 3 months to rebuild the site.

Thank you in advance

 

Capture.PNG

Link to comment
Share on other sites

Hi,

ask your hosting the IP address of the database server or the hostname of the Database server and try to use that in your parameters.php config file. Usually works with localhost, but there are some servers hosting where it's working with an IP or hostname.

Also was this working, and just suddenly has stopped working? what exactly happened before this has stopped working? a server update/cPanel update, or maybe you've installed some new modules or made some modifications in Backoffice or files?

Kind regards, Leo

  • Like 1
Link to comment
Share on other sites

1 hour ago, Prestachamps said:

Hi,

ask your hosting the IP address of the database server or the hostname of the Database server and try to use that in your parameters.php config file. Usually works with localhost, but there are some servers hosting where it's working with an IP or hostname.

Also was this working, and just suddenly has stopped working? what exactly happened before this has stopped working? a server update/cPanel update, or maybe you've installed some new modules or made some modifications in Backoffice or files?

Kind regards, Leo

Hi Leo

Thank you for your prompt response. i have moved my websites to a new host. The sites was running perfectly on the old host, but their service with errors etc were terrible.

Then i reloaded the sites, only to get this error and the new host claims they have looked at the error and ensured me it is not on their side.
I will contact them now and get the info you suggest and try it.

Thank you again

Much appreciated

Link to comment
Share on other sites

Hi,
when you moved to the new hosting was also your database user and database name changed on the new hosting?

you can check it by copying an adminer type of database manager script  (  https://www.adminer.org/ ), and check to login using that script, to be sire that your database credentials are correct. Also you could ask your hosting to re-send you all the database credentials, and maybe reset your database password, just to be sure that you are connecting to the correct database/server.

If you can then connect with the adminer script , then those credentials should be added to the prestashop's parameters file.

Also don't forget to delete the adminer script from server after testing it.

Kind regards, Leo

  • Like 1
Link to comment
Share on other sites

Hi Leo

I keep getting the same error on 2 different websites i have just moved to a new Host.

I want to ask if you can give me some pointers as to what I need the Host to look at, since it seems the problem is from their side, but they are saying to me that I have to get a Prestashop Expert to solve the problem.

I have been doing research for about 3 weeks and have came across it time and again where people say the problem is on the Host side

See the post below where Bellini13 says it is a Host error

If I can point the Host in the right direction, i am sure they can solve it, however, I just don't know enough to insist that they investigate further.

Thanks in advance

Link to comment
Share on other sites

  • 9 months later...
  • 8 months later...

I got the "Link to database cannot be established: SQLSTATE[HY000] [2002] No such file or directory at line 136 in file classes/db/DbPDO.php" error in my development site. I am using 1.7.8.0 there on a sharered host with cpanel. After comparing the parameters.php in /app/config for both dev site and prod site I noticed that dev site had 'localhost' for db-address while the prod site had '127.0.0.1'. So I changed dev to '127.0.0.1' and then I got the login screen to BO but after loging in I got a white screen. The error log now pointed towards another file with PDOExeption and when looking further into the logs I noticed that 'localhost' was used as address.

So I changed back again to 'localhost'. Deleted all under /var/cache/ and after that everything works:-)

I hope this might help someone else with the same issue.

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