You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but with DATABASE_URL defined in /.env as mysql://user:pass@127.0.0.1:3306/symfony?charset=utf8&serverVersion=5.5 it doesn't work and on attempt to save something to session I'm getting this error:
SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected
The text was updated successfully, but these errors were encountered:
PdoSessionHandler uses default PDO and that's why default connection string doesn't works. The only way now is to write your own custom session handler to use connection string. You can extend bundled handler and rewrite constructor to parse string and define all vars needed.
or easier you can write all your vars in services.yaml
@aik099 thanks for reporting this problem. I agree that it's unfortunate to support incompatible DSN syntaxes. I've opened symfony/symfony#25186 to ask the community to add support to Doctrine DSN in future Symfony versions. So I'm closing this issue until the other one is fixed. Thanks!
According to docs on https://symfony.com/doc/current/doctrine/pdo_session_storage.html page to avoid duplication the
PdoSessionHandler
needs to be configured like this:Unfortunately when Symfony project is created using Flex there are no such container parameters anymore.
I've tried doing:
but with
DATABASE_URL
defined in/.env
asmysql://user:pass@127.0.0.1:3306/symfony?charset=utf8&serverVersion=5.5
it doesn't work and on attempt to save something to session I'm getting this error:The text was updated successfully, but these errors were encountered: