pdo中不同數(shù)據(jù)庫(kù)驅(qū)動(dòng)dsn配置如下:
mysql:
mssql:host=localhost;dbname=testdb
mysql:host=localhost;port=3307;dbname=testdb
mysql:unix_socket=/tmp/mysql.sock;dbname=testdb
sqlite:
sqlite:/opt/databases/mydb.sq3
sqlite::memory:
sqlite2:/opt/databases/mydb.sq2
sqlite2::memory
odbc:
odbc:testdb
odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\db.mdb;Uid=Admin
odbc:DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=localhost;PORT=50000;DATABASE=SAMPLE;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibmdb2;
oci:
oci:dbname=//localhost:1521/mydb
pgsql:
host=localhost port=5432 dbname=testdb user=bruce password=mypass
php支持的數(shù)據(jù)庫(kù)引擎:
Cubrid
FreeTDS / Microsoft SQL Server / Sybase
Firebird/Interbase 6
IBM DB2
IBM Informix Dynamic Server
MySQL 3.x/4.x/5.x
Oracle Call Interface
ODBC v3 (IBM DB2, unixODBC and win32 ODBC)
PostgreSQL
SQLite 3 及 SQLite 2
Microsoft SQL Server / SQL Azure
4D