Pascal Data Objects

MySQL DSN Options

The PDO MySQL Data Source Name (DSN) is composed of the following elements:

The DSN prefixes are mysql-4.0, mysql-4.1, and mysql-5.0

host: The hostname on which the database server resides.
port: The port number where the database server is listening.
dbname: The name of the database.
unix_socket: The MySQL unix socket (shouldn't be used with host or port).

Examples

pdo:mysql-4.1://host=localhost;dbname=testdb
pdo:mysql-4.0://host=localhost;port=3307;dbname=testdb
pdo:mysql-5.0://unix_socket=/tmp/mysql.sock;dbname=testdb