Chapter 3. Driver options

Your application has to initialize libdbi drivers by setting some driver options with the dbi_conn_set_option() and the dbi_conn_set_option_numeric() library functions. The mysql driver supports the following options:

host

The hostname or IP address of the MySQL database server. Use an empty string or "localhost" to connect to a MySQL server running on the local machine.

port (numeric)

The port used to remotely connect to the MySQL database server over TCP. Use "0" (zero) to accept the default socket.

username

The name of the user accessing the database.

password

The password of the user accessing the database.

dbname

The name of the database used for the initial connection.

mysql_include_trailing_null (numeric)

This item will tell the driver whether or not to include trailing null values ('\0') at the end of binary strings. This applies to the types BLOB, MEDIUMBLOB, LARGEBLOB etc. A numeric value of 0 will tell the driver to leave off the NULL value. A value of 1 will tell the driver to include the trailing NULL character.

mysql_unix_socket

The filename of the Unix socket used to connect to a MySQL database server running on the local machine. Provide an empty string to use the default socket.

mysql_compression (numeric)

A value larger than zero causes the client/server communication to be compressed. Set this to zero to use no data compression.