0

I recently upgrade from EE2 to EE5 locally on my laptop before moving to a remote location. When moving to a remote location, I get database errors.

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
ee/legacy/database/drivers/mysqli/mysqli_connection.php:78

Has anyone seen this? I need help figuring this out.

Thanks!

2 Answers 2

3

In EE 3/4/5, your database connection configuration lives in your system/user/config/config.php file. The configuration should look like this:

$config['database'] = array (
    'expressionengine' =>
        array (
            'database' => '',
            'hostname' => '',
            'username' => '',
            'password' => ''
        ),
);

Fill in the array with your appropriate values.

If this information is there and correct, you need to diagnose your MySQL running instance and verify your credentials actually work. I would recommend testing at the command line like so (when SSHed into your server):

mysql -h {mysql_server_address} -u {user_name} -p

This should then prompt you with a password, which if you get correct, should log you into the MySQL CLI. If this doesn't work from your command line, your server most likely can't connect to the MySQL server and you need to start from there.

1
  • This is it. For some reason, my build was missing username, so once I added it worked. Thanks! Commented Jan 8, 2020 at 0:24
0

Looks like you need to check that the updated installation has the correct information about how to access MySQL on your remote server.

In EE2 this information was stored in a separate file (database.php) in your config folder. In EE5 this information is included in the main config.php file - so it is possible that you made the changes but to the wrong file...

Good luck!

HTH

1
  • I think you're right, but I have yet to find the answer. Commented Jan 7, 2020 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.