Jump to content

SQLSTATE[HY000] [1045] Access denied for user 'root@localhost' (using password: YES) at line 127 in file classes/db/DbPDO.php


sajdis

Recommended Posts

Hey everyone,

so sorry if I missed the right topic but I'm new using prestashop. Today I saw a problem that suddenly my page doesn't work. I turned on debug function and it gave me this error. What should I do next? Can someone help me fixing this? :(

SQLSTATE[HY000] [1045] Access denied for user 'root@localhost' (using password: YES)
at line 127 in file classes/db/DbPDO.php

 

122.     public function connect()
123.     {
124.         try {
125.             $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
126.         } catch (PDOException $e) {
127.             throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
128.         }
129. 
130.         $this->link->exec('SET SESSION sql_mode = \'\'');
131. 
132.         return $this->link;
Link to comment
Share on other sites

  • 1 year later...
14 hours ago, ohpasic said:

+1

Hi Folks,

I've just run exactly to this error one of my test servers....

  • All config files are correct
  • user/password OK from bash
  • user/password OK from phpmyadmin ...

the tables seems correct,

i've no idea what's wrong...

Well .... I dunno how and why, PHP(7.[23])'s PDO class converts the given 127.0.0.1 host to FQDN of the server!

I gave rights the db-user (access via FQDN), and PS started to work

Very-very strange.

If anyone can test the exact situation and have idea why it is happened, feel free to share 😉

Link to comment
Share on other sites

  • 3 weeks later...

Hi, same problem here :)

The access to the database don't work...

Configuration :

  • VPS Server + Plesk

The "access denied" with 3 errors :
 

Quote

 

(1/3) PDOException // SQLSTATE[HY000] [1045] Access denied for user 'bdd_moldsmarket_admin'@'localhost' (using password: YES)

(2/3) PDOException // SQLSTATE[HY000] [1045] Access denied for user 'bdd_moldsmarket_admin'@'localhost' (using password: YES)

(3/3) ConnectionException // An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'bdd_moldsmarket_admin'@'localhost' (using password: YES)

 

 

On 9/7/2020 at 6:56 AM, ohpasic said:

Well .... I dunno how and why, PHP(7.[23])'s PDO class converts the given 127.0.0.1 host to FQDN of the server!

I gave rights the db-user (access via FQDN), and PS started to work

Very-very strange.

If anyone can test the exact situation and have idea why it is happened, feel free to share 😉

what your solution here? i don't understand "give rights the db-user [...]".

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