Jump to content

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


Recommended Posts

After trying to upgrade from 1.6.0.6 to 1.6.0.11 using Softaculous (the 1 click upgrade din't work) my website doesn't work anymore. The upgrade stalls each time at 95%.

 

Now while visiting the website I get an error 500 message and when I try to log into the backoffice I always get this message:

 

Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user 'xxxxxxx'@'localhost' (using password: YES)

 

Can someone please help?

 

Thank you.

Link to comment
Share on other sites

Thank you, Nemo1. Is there a way to find out how to do this in a few simple steps? This message shows up when the error reporting is enabled: [PrestaShopDatabaseException]

Link to database cannot be established: Access denied for user 'xxxxxx'@'localhost' (using password: YES)

at line 47 in file classes/db/DbMySQLi.php

42. 		else43. 			$this->link = @new mysqli($this->server, $this->user, $this->password, $this->database);44. 45. 		// Do not use object way for error because this work bad before PHP 5.2.946. 		if (mysqli_connect_error())47. 			throw new PrestaShopDatabaseException(sprintf(Tools::displayError('Link to database cannot be established: %s'), mysqli_connect_error()));48. 49. 		// UTF-8 support50. 		if (!$this->link->query('SET NAMES \'utf8\''))51. 			throw new PrestaShopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));52. 
Link to comment
Share on other sites

I have had exactly the same error message.

Do you have a special non alphabetic sign in your MySQL password?

Check your config/settings.inc.php file: the migration process had added a \ (escape backslash) in my MySQL password. Just erase it, save, and launch your admin PS page again.

  • Like 1
Link to comment
Share on other sites

Thank you for the reply, Nemo1. I run PHP Version 5.4.36., but since my website was down for several days :(  I decided to test another open source e-commerce platform which seems easier to configure, very customizable, and quite fast. I ran into these problems while trying to upgrade from 1.6.0.6 to 1.6.0.11 using Softaculous (because 1-click upgrade didn't work in my case either). The upgrade stalled at 95% and messed up my old installation. Maybe I should have kept the older version without trying to upgrade it... Thanks anyway. :mellow:

Link to comment
Share on other sites

  • 8 months later...

Just wanted to give my thanks to Orphee. I looked in the config/settings.inc.php file and found an extra \ in the password - mine was in the middle of the password, not at the end like his. But removing it, saving and reloading worked for me. Definitely worth trying before going right to the backup if you’re getting this error. Probably just saved me hours of work.

THANK YOU!

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