'Connect Symfony/Doctrine to MS SQL Server

I need to connect my symfony project to a SQL Server database. I have some probleme when using doctrine. The error I get is :

An exception occurred in the driver: SQLSTATE [28000, 18456]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Échec de l'ouverture de session de l'utilisateur 'voipsync'.

Here is part of my doctrine.yaml config file :

        sqlserver:
            #url: 'sqlsrv://voipsync:voipsync@[MY SERVER]\VIRTUALIA:1433/VirtualiaRh'
            driver: 'sqlsrv'
            user: voipsync
            password: voipsync
            host: [MY SERVER]\VIRTUALIA
            port: 1433
            dbname: VirtualiaRh
            charset: UTF-8
            server_version: '13'

For information, I have tested the connexion in direct PHP without using doctrine, it works perfectly. I must be missing something in the Doctrine config.

My setup : symfony serve on Windows 10, versions are Symfony V5.4.8 / Doctrine DBAL 3.3.6 / MS SQL Server 2016

Thanks in advance for your help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source