fbpx
January 27, 2025

Query strings in database urls do not map to PDO options – March 20, 2023 at 06:32AM

Hello all

At work my hosting provider gives the following DSN for connecting to the MySQL database : `mysql://{user}:{password}@{host}:{port}}/{dbname}?useSSL=true&verifyServerCertificate=false`.

Note the query strings at the end.

When I pass that to the url keys on the database config, the two query string appear in the connection’s config, but they do nothing.

They should be equivalent to the PDO options `PDO::MYSQL_ATTR_SSL_CA` and `PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT` constants, but unless I set these constants in the options keys of the BD config, they do nothing.

So my question is : how standard are these query strings ?

Shouldn’t the framework or the connection class itself map them to something useful ?

Thanks !

submitted by /u/FlorentP67
[link] [comments]

%d bloggers like this: