Pimcore upgrade to 6 An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

Hello,
I’m trying ti upgrade to pimcore v6 (from latest 4) and i have this message :

An exception occured while establishing a connection to figure out your platform version. You can circumvent this by setting a ‘server_version’ configuration value For further information have a look at: https://github.com/doctrine/DoctrineBundle/issues/673

An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user ‘root’@‘localhost’ (using password: NO)

It seems that the config in /var/config/system.php is not read because i didn’t have “root” for the username;

Someone has an idea ?

Thank you;

1 Like

The database config has moved to /app/config/local/database.yml. The upgrade guide explains how the new file should be https://pimcore.com/docs/6.x/Development_Documentation/Installation_and_Upgrade/Updating_Pimcore/V5_to_V6.html

Fix this and your system should work. I was getting that error message even after fixing the database config (even though everything actually worked). In that case you can add server_version to the config and set it to the version of mysql you are using. This will prevent the error messages.

This is my database.yml.

doctrine:
    dbal:
        connections:
            default:
                server_version: 5.7.26
                user: pimcore
                password: password
                dbname: pimcore
                host: localhost
                port: 3306

I am using mysql 5.7.26. You find your version by running the command mysql -V in your terminal.

1 Like

Thank you very much i didn’t saw this doc.
It was that.