We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

News and General

Chad Crowell's avatar
Chad Crowell
242 posts
6 years ago
Chad Crowell's avatar Chad Crowell

I don’t know where these database parameters are coming from….

I have a EE5 site that I just upgraded from EE2 that works great locally. I’ve deployed the files and db to the development server, and am getting this error: https://d.pr/i/ArJAIp

When I open ee/legacy/database/drivers/mysqli/mysqli_connection.php at line 81, I can see this is an open function for the db connection. If I run die($username) or die($password) on line 76, just above the $this->connection = @new PDO definition, they die with the correct username and password from my database config file. If I hard code the username and password into the $this->connection = @new PDO definition, everything works. However, the connection is erring with root/root as shown in line #0 of the stack trace above. I can see also in that line, that the dbname variable is being recognized, as my db name does start with “au”. This is very confusing… why would it be trying to connect with root/root when the username/password are correctly defined in variables when die()’d in the line above this error?

       
Chad Crowell's avatar
Chad Crowell
242 posts
6 years ago
Chad Crowell's avatar Chad Crowell

Ugh, ignore me. My main db config file was correct, but I have an add-on that connects to an external db and I had some domain references wrong there. Fixed.

       
Derek Jones's avatar
Derek Jones
7,561 posts
6 years ago
Derek Jones's avatar Derek Jones

Hey Chad, glad you found it, and welcome back to the forums!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.