# Is it necessary to have different DSN formats in PDO ?

- Thread: https://externals.io/message/19891
- Original archive: https://news-web.php.net/php.internals/19891
- Started by Andrey Nikolaev on 2005-11-02T14:54:09+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #19891 — Andrey Nikolaev — 2005-11-02T14:54:09+00:00

URL: https://externals.io/message/19891#19891

What we have now is...

"mssql:host=localhost;dbname=testdb"
"sybase:host=localhost;dbname=testdb"
"dblib:host=localhost;dbname=testdb"
"mysql:host=localhost;dbname=testdb"

"pgsql:host=localhost port=5432 dbname=testdb user=bruce password=mypass"
"oci:dbname=//localhost:1521/mydb"
"firebird:User=john;Password=mypass;Database=DATABASE.GDE;DataSource=localhost;Port=3050"
"sqlite:/opt/databases/mydb.sq3"

Maybe it's better to make it more standart ?
Like:
"driver:host=localhost; port=1234; user=bruce; password=mypass; dbname=testdb"
"driver:file=/path/to/sql.socket; user=bruce; password=mypass; dbname=testdb"

It's much easer to write, parse and generate.  Only don't know what to do with ODBC:

"odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\db.mdb;Uid=Admin"
"odbc:DSN={IBM DB2
ODBC};HOSTNAME=localhost;PORT=50000;DBNAME=SAMPLE;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibmdb2;"

---

## #19892 — Wez Furlong — 2005-11-02T15:01:42+00:00

URL: https://externals.io/message/19891#19892 · In reply to: #19891

That's one of the reasons why we don't do it.

--Wez.


> It's much easer to write, parse and generate.  Only don't know what to do with ODBC:
>
> "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\db.mdb;Uid=Admin"
> "odbc:DSN={IBM DB2
> ODBC};HOSTNAME=localhost;PORT=50000;DBNAME=SAMPLE;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibmdb2;"

---

## #19894 — Lukas Smith — 2005-11-02T23:03:28+00:00

URL: https://externals.io/message/19891#19894 · In reply to: #19892

Wez Furlong wrote:
> That's one of the reasons why we don't do it.

I once proposed that every driver should atleast be able to generate a 
DSN from an array through an optional function. However since I never 
implemented and nobody else stepped out it never materialized.

regards,
Lukas
