Jump to content

Link To Database Cannot Be Established: Sqlstate[Hy000] [1045] Access Denied For User 'root'@'lo


Recommended Posts

After 1-click upgrade  from 1.6.1.2 to 1.6.1.4 I have this error?

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

 

I see some changes in the settings.inc.old.php and the new one.

Old: 

<?php

define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'Prestashop_1502');
define('_DB_USER_', 'root');
define('_DB_PASSWD_', 'xxxxxxxxxxx');
define('_DB_PREFIX_', 'ps_');
define('_MYSQL_ENGINE_', 'InnoDB');
define('_PS_CACHING_SYSTEM_', 'CacheFs');
define('_PS_CACHE_ENABLED_', '0');
define('_COOKIE_KEY_', 'Vsiku6pdu4ESdNMobYK2rjqIxKKgMYkiKjbKgT53dFsNYGdxf8p0QNUS');
define('_COOKIE_IV_', 'j5kx9mLo');
define('_PS_CREATION_DATE_', '2015-10-30');
if (!defined('_PS_VERSION_'))
define('_PS_VERSION_', '1.6.1.2');
define('_RIJNDAEL_KEY_', 'yNfBeZDii744qzRDT5zuLSAYdohjxIyt');
define('_RIJNDAEL_IV_', '77/YoM+AlVNZ+FOmC+dlrQ==');
 
New:
<?php
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'Prestashop_1502');
define('_DB_USER_', 'root');
define('_DB_PASSWD_', 'xxxxxxxx');
define('_DB_PREFIX_', 'ps_');
define('_MYSQL_ENGINE_', 'InnoDB');
define('_PS_CACHING_SYSTEM_', 'CacheFs');
define('_PS_CACHE_ENABLED_', '0');
define('_COOKIE_KEY_', 'Vsiku6pdu4ESdNMobYK2rjqIxKKgMYkiKjbKgT53dFsNYGdxf8p0QNUS');
define('_COOKIE_IV_', 'j5kx9mLo');
define('_PS_CREATION_DATE_', '2015-10-30');
define('_PS_VERSION_', '1.6.1.4');
define('_RIJNDAEL_KEY_', 'yNfBeZDii744qzRDT5zuLSAYdohjxIyt');
define('_RIJNDAEL_IV_', '77/YoM+AlVNZ+FOmC+dlrQ==');
define('_PS_DIRECTORY_', '/../../');
 
 
Nothing else changed. I have made a copy of both local Site complete and SQL database.
 
I can't find this error here so I post new one. 
 
I hope someone can tell me what to do?
 
Regards Ed
 
Link to comment
Share on other sites

I'm afraid you can't ignore the MySQL error here. The password is indeed incorrect.

The password hasn't changed at all

I've used 1-click upgradebutton. Everything looks well and when ready I go to another page in thebackend I get imediatly this error

Glad I had a backup of both. So I put back both, my sql copy and my site and I'm back to where I started.

 

For me this way of Upgrade is not save or reliable.

Link to comment
Share on other sites

 

according to what you provided, it would appear that the new password is shorter...

 

These crosses are just there so no one is able to see my password. I typed them by hand and as I already said no password has been changed during upgrade from moment one to two. So it has nothing to do with any password it has to do with the upgrade. Before upgrade all up and running. Then 2 minutes later after 1-click upgrade... Error??

Why would I change password anyway? It's the upgrade causing the error and I just want to know why?

 

Because I want to be able to upgrade to newer version without any hassle. This is the first time I ever used 1-click upgrade and all marks where green with the exception for this:

PHP's max_execution_time instelling heeft een hoge waarde of is volledig uitgeschakeld (huidige waarde: 2880 seconden)warning.gif

But that is just a warning about execution time. And the upgrade did not even take 3 minutes!
 
So any other suggestion?
Edited by Ed van der Meer (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Another suggestion with it's own query... The following might be a useful answer: DerrickJames commented on Jul 9, 2014

"It is clear that you've set your environment to local, so you also need to set your database configuration on your local environment. So go to the app folder > config folder there's a local folder inside of which there's a database.php file. Set your database configurations there and the sky will stop falling on you!"

 

Assuming your database is loaded, the above answer seems straightforward. Where would the database be accessible in the desktop version, it may just be in the "Cloud" as a separate download. Where then should it be placed on the desktop download?

Link to comment
Share on other sites

I have suddenly had this similar error come up when trying to access both my backend and frontend

 

"Link to database cannot be established: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"

 

I haven't upgraded anything to do with Prestashop I am very happy with the version I have.  If you CAN help please keep in mind I fall into the category of techno moron.  I have a basic understanding of what an SQL database is but thats it.   

 

Regards

Eddy

Link to comment
Share on other sites

I haven't upgraded anything to do with Prestashop I am very happy with the version I have.  If you CAN help please keep in mind I fall into the category of techno moron.  I have a basic understanding of what an SQL database is but thats it. 

 

You say that as though you have upgraded other things? 

 

Did you upgrade PHP?  Why not provide some more information about what you may have done.

 

Did you contact your hosting provider?

Link to comment
Share on other sites

  • 7 months later...
  • 1 month later...

I had the same problem. Here a solution:

 

 

/clickandbuilds/PrestaShop/MyeCommerce2/config

 

edit this file with text:

config.inc.php

 

there you see the Password what is logged into the Database. This have to be the same like in your Control Panel used Database Password.

 

This shoud help.

Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...
  • 6 months later...
  • 2 years later...
On 3/29/2016 at 1:43 PM, bellini13 said:

It most certainly is a server issue.  The error says that Prestashop cannot connect to the database, so something must have changed if it was working at some point.  Contacting your hosting provider is the correct action at this point

Hi Bellini13

Could you please give me more information in regards to this error being on the Host side.

I have contacted my Host about this, and they seem to think it is a Prestashop problem.

I have recently moved 2 sites to this new Host and both the sites give the exact same error.

Please advise

Thank you

 

Edited by ctcamp
More information (see edit history)
Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

If you have this problem, go in /app/config/parameters.php and edit the ip you have 

And add:

    'database_port' => '3306',

And it will be fixed!  

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